When running the following, I get a response and the zcrm_oauthtokens.txt file is saved, but both only have an access token but the refresh token is blank.
- $configuration = [
- "client_id" => $client_id,
- "client_secret" => $client_secret,
- "redirect_uri" => $redirect_uri,
- "currentUserEmail" => $currentUserEmail,
- "token_persistence_path" => $token_persistence_path
- ];
- ZCRMRestClient::initialize($configuration);
- try {
- $oAuthClient = \zcrmsdk\oauth\ZohoOAuth::getClientInstance();
- $oAuthTokens = $oAuthClient->generateAccessToken($grantToken);
- print_r($oAuthTokens);
- } catch (Error $e) {
- echo $e->getMessage();
- }
Here's the print_r() result I get:
zcrmsdk\oauth\utility\ZohoOAuthTokens Object ( [refreshToken:zcrmsdk\oauth\utility\ZohoOAuthTokens:private] => [accessToken:zcrmsdk\oauth\utility\ZohoOAuthTokens:private] => 1000.blahblah [expiryTime:zcrmsdk\oauth\utility\ZohoOAuthTokens:private] => 1584131163031 [userEmailId:zcrmsdk\oauth\utility\ZohoOAuthTokens:private] => )
It does not return a refreshToken. Same in the zcrm_oauthtokens.txt file.