Hi, Iām a new user of SuiteCRM, and spent a few hours yesterday with exactly the same problem. Iām using 7.11.0, but assume itās the same set up as 7.10.11 for the API.
I tracked my issue down, and it was due to Rewriting being turned off (as expected), however not because mod_rewrite was disabled but because the image Iām using (a docker image from bitnami) disables rewriting by default in the apache config files.
āAllowOverride Noneā needs to be āAllowOverride Allā for the .htacess file to function.
The documentation on which URLs are the correct ones for the V8 API isnāt great. The latest docs look to be here: https://deploy-preview-90āsuitedocs.netlify.com/developer/api/version-8/json-api-new/ but arenāt quite correct as they omit the use of ā/Api/ā in the path I.E. itās ā/Api/V8/moduleā not just ā/V8/moduleā.
I found the access_token URL is: http://mysite/Api/access_token
then if you actually want to do anything once you have the access token you have to parse the token into the header request of the module youād like to call, with a base url of: http://mysite/Api/V8/module/
Hereās an example in PHP that Iāve been playing with that pulls a list of all accounts:
$token_url = 'http://mysite/Api/access_token';
$module_url = 'http://mysite/Api/V8/module/';
$client_id = '12345678-1234-1234-1234-1234512345';
$client_secret = 'its a secret';
$ch = curl_init();
$header = array(
'Content-type: application/vnd.api+json',
'Accept: application/vnd.api+json'
);
$postStr = json_encode(array(
'grant_type' => 'client_credentials',
'client_id' => $client_id,
'client_secret' => $client_secret
));
curl_setopt($ch, CURLOPT_URL, $token_url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POSTFIELDS, $postStr);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
$output = curl_exec($ch);
$out = json_decode($output,true);
$ch = curl_init();
$header = array(
'Content-type: application/vnd.api+json',
'Accept: application/vnd.api+json',
'authorization: Bearer '.$out["access_token"]
);
$item = 'Accounts?sort=-name';
curl_setopt($ch, CURLOPT_URL, $module_url . $item);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
$output = curl_exec($ch);
echo $output;
I now have another issue to do with permissions, but Iāll make it a new post.