SuiteCRM Rest API documentation

Hi Team

Do we have API support for SuiteCRM? Where can I find API documentation for suiteCRM?

Anybody has done any development using Rest API? Please let me know the information.

Regards
Kiran Ghataeg

UPDATE FEBRUARY 22, 2018: New Rest API documentation on docs.suitecrm.com:

We’ve created a brand new, fully compliant Rest API (v8) in SuiteCRM 7.10! The v8 API mirrors the prior API functionality so there will be no loss of functionality. It also introduces authentication using OAuth 2.0 and bringing the SuiteCRM API up to industry standards. The new v8 API adopts the Swagger (OpenAPI v3.0) framework to provide detailed and clear information.

Please head to the new documentation site to learn how to use the new API: https://docs.suitecrm.com/developer/api/version-8/. For a list of all API methods, check out the appendix: https://docs.suitecrm.com/developer/appendix-b---api-methods/


Hi,

SuiteCRM has REST and SOAP API support, the docs are unfortunately a bit lacking at the moment however the API is still compatible with SugarCRM’s v4 API.

The Joomla portal plugin uses the API extensively so this may be a good place to check real world usage of the API. This can be found on GitHub (https://github.com/salesagility/SuiteCRM-Portal-Joomla) or on the SuiteCRM downloads page (https://suitecrm.com/download).

Hope this helps,
Jim

1 Like

/* $url = “https://demo.suiteondemand.com/service/v4_1/rest.php”;
$username = “will”;
$password = “will”; */
//you can uncomment above credentials for testing purpose

$url = “http://{suitcrm or sugar crm url}/service/v3_1/rest.php”;
$username = “username”;
$password = “password”;
function call($method, $parameters, $url)
{
ob_start();
$curl_request = curl_init();

curl_setopt($curl_request, CURLOPT_URL, $url);
curl_setopt($curl_request, CURLOPT_POST, 1);
curl_setopt($curl_request, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
curl_setopt($curl_request, CURLOPT_HEADER, 1);
curl_setopt($curl_request, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl_request, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_request, CURLOPT_FOLLOWLOCATION, 0);

$jsonEncodedData = json_encode($parameters);

$post = array(
“method” => $method,
“input_type” => “JSON”,
“response_type” => “JSON”,
“rest_data” => $jsonEncodedData
);

curl_setopt($curl_request, CURLOPT_POSTFIELDS, http_build_query($post));
$result = curl_exec($curl_request);
$http_status = curl_getinfo($curl_request, CURLINFO_HTTP_CODE);
//print_r($http_status);
//print_r($result);
curl_close($curl_request);

$result = explode("\r\n\r\n", $result, 2);
$response = json_decode($result[1]);
ob_end_flush();

return $response;
}

//login
$login_parameters = array(
“user_auth” => array(
“user_name” => $username,
“password” => md5($password),
“version” => “1”
),
“application_name” => “RestTest”,
“name_value_list” => array(),
);

$login_result = call(“login”, $login_parameters, $url);
/*
echo “

”;
print_r($login_result);
echo “
”;
*/
//get session id
$session_id = $login_result->id;
1 Like

Hai Balwinder829,

I need to Add Sms Module in Suitecrm…and rest is used at any part in sms module…

Can you explain where i need to paste the code…

Thanks in advance

Good day,

Looking at the latest SuiteCRM Version 7.10-RC (Sugar Version 6.5.25 (Build 344)) that refer to in the release notes to" New REST API

Brand New fully compliant Rest API
Swagger documentation"

I have done the upgrade to 7.10-RC but unable to find any new REST APIs in the install base. Does anyone have some additional information to help me find the new rest apis to test and sample?

Kind regards
Hennie

I don’t really know the answer, but looking around I see this on branch “develop” (which is where the RC comes from):

https://github.com/salesagility/SuiteCRM/tree/develop/lib/API

I think v8 is the new API.

Documenting the new API is scheduled to happen a few weeks after the 7.10 release. We need Daniel, the developer that did most of the work on the new API, to help on the documentation and he will only have time after the release.

Thank you for the quick response.

It seems to be a bit confusing at this point. I also found the V8 Swagger.Json file in lib/API/v8 but the Json file is not a valid well formed version that we can use in Swagger UI or Editor.

Kind regards
Hennie

Does your Swagger Editor support Swagger v3 spec?

Yes, I am able to use OpenAPI json or yaml files using the following docker build image - https://hub.docker.com/r/swaggerapi/swagger-editor/

There seems to be a number of errors on the Swagger file if loaded as is.

I read the README and I don’t see them mentioning Swagger v3 API anywhere. When they link to the Swagger Github, they link to v2.

(the Swagger editor is at version 3.x, but that’s a different thing).

I don’t know if this version problem covers all issues - there might be real problems. But we would need to be checking them with software that fits the version of Swagger we’re using…

New Rest API documentation on docs.suitecrm.com:

For the people that find this thread: we’ve created a brand new, fully compliant Rest API (v8) in SuiteCRM 7.10! The v8 API mirrors the prior API functionality so there will be no loss of functionality. It also introduces authentication using OAuth 2.0 and bringing the SuiteCRM API up to industry standards. The new v8 API adopts the Swagger (OpenAPI v3.0) framework to provide detailed and clear information.

Please head to the new documentation site to learn how to use the new API: https://docs.suitecrm.com/developer/api/api-8/. For a list of all API methods, check out the appendix: https://docs.suitecrm.com/developer/22.-appendix-b—api-methods/.

2 Likes

Thanks but both those pages currently don’t seem to be there -

“Woops. Looks like this page doesn’t exist ¯_(ツ)_/¯.”

The documentation site is brand new and we’re still rearranging content. Sorry about that. Here are the working links:

Please head to the new documentation site to learn how to use the new API: https://docs.suitecrm.com/developer/api/version-8/

For a list of all API methods, check out the appendix: https://docs.suitecrm.com/developer/appendix-b---api-methods/

Demo server https://demo.suiteondemand.com/api/v8/schema return 404 with error message


Not Found

The requested URL /lib/SuiteCRM/API/public/index.php/v8/schema was not found on this server.

The correct file location is /lib/API/public/index.php Need update virtual host httpd.conf setting?

Hey everyone

Are there any docs on how to extend new V8 API?

I don’t see any content on how to exnted V8 API on official docs site: https://docs.suitecrm.com/developer/api/version-8/

Currently, no. It’s being slightly refactored so we’re not encouraging extensions yet.