Followed docs for the API-Version-8.
When I run a simple test with a OAuth2 Client
From the docs
Authentication with Client Credentials
POST /api/oauth/access_token
$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’ => ‘3D7f3fda97-d8e2-b9ad-eb89-5a2fe9b07650’,
‘client_secret’ => ‘client_secret’,
‘scope’ => ‘’
));
$url = ‘https://path-to-instance/api/oauth/access_token’;
curl_setopt($ch, CURLOPT_URL, 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);
Using my corrected URL and client_id (also have to update the line for CURLOPT_URL, $url
The response is not a token.
I get
the response(output):
{“error”:“invalid_client”,“message”:“Client authentication failed”}
In the logs --> “POST /{{INSTANCE}}/api/oauth/access_token HTTP/1.1” 401 67 “-” “-”
- How can I test and confirm the function of the v8 API ?
What other details should I provide? (php v7.2.4 , PCRE 8.41 ) SuiteCRM 7.10.2
Any pointers or additional details beyond the docs at https://docs.suitecrm.com/developer/api/version-8/ ?
thanks for your time