This is my Code for getting token.
$code=$_REQUEST['code'];
$APPKEY="u8hj81KeQ9uQDyA1PBTTgw";
$req='https://platform.devtest.ringcentral.com/restapi/oauth/token';
$post = array (
'grant_type' => 'authorization_code',
'code' => $code ,
'redirect_uri' => 'http://localhost/token.php');
$ch = curl_init($req);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$apiKey = base64_encode($APPKEY);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Authorization: Basic ' . $apiKey,
'Accept: application/json',
'Content-Type: application/x-www-form-urlencoded'));
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
curl_close($ch);
$r=json_decode($response, true);
And the Response is
array (size=3) 'error' => string 'invalid_client' (length=14) 'error_description' => string 'Invalid client: ' (length=16) 'errors' => array (size=1) 0 => array (size=3) 'errorCode' => string 'OAU-153' (length=7)
'message' => string 'Invalid client: ' (length=16)
I am using the same Client ID for getting authorized Code.
Please Help me what is Wrong.