ZohoOAuthException, Can't generating Access token from Grant token
Hello, here my code : PHP SDK for Zoho API
function __construct() {
$configuration = [
'client_id' => '***',
'client_secret' => '***',
'redirect_uri' => 'www.zohoapis.eu',
'currentUserEmail' => '***',
'token_persistence_path' => '***',
'applicationLogFilePath ' => '***',
];
$http = new Client();
$response = $http->post('https://accounts.zoho.eu/oauth/v2/token', [
'code' => '***',
'redirect_uri' => '***',
'client_id' => '***',
'client_secret' => '***',
'grant_type' => 'authorization_code',
]);
if (isset($response->json['access_token'])) {
$grantToken = $response->json['access_token'];
} else {
dd($response->json['error']);
die();
}
ZCRMRestClient::initialize($configuration);
$oAuthClient = ZohoOAuth::getClientInstance();
$oAuthTokens = $oAuthClient->generateAccessToken($grantToken);
}
Return error : Caused by:'Exception while fetching access token from grant token
INFO : I use Token file persistence, because I can't rename tables on my shared host.
Aloso, what's the differente entre grant token or refresh token ?
Thx,