I need to generate an access token Oauth2.0 to call a webservice.
My PHP script return an access token but when i call the webservice with this token i have an error code 115 (OAuth access token is not valid).
$client_id = 'XXXXX';
$client_secret = 'XXXXX';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,'XXXXX/auth/oauth/v2/token' );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt($ch, CURLOPT_POST, 1 );
curl_setopt($ch, CURLOPT_POSTFIELDS, 'grant_type=client_credentials');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Basic '.base64_encode($client_id.':'.$client_secret)));
$res = curl_exec($ch);
I tried with postman to generate an access token with the same datas such as my PHP script i have the same error code (115) but when i add the scope datas, the access token generate is now valid to call the webservice.
Do you know how to include the scope datas on my PHP script ?