Hello, I am using the Zoho CRM API for the first time. I'm using the PHP SDK and running into this error:
'No Tokens exist for the given user-identifier,Please generate and try again.'
this is generated at line 60 of zohocrm/php-sdk/src/com/zoho/oauth/clientapp/ZohoOAuthPersistenceByFile.php
I don't see any results for this error in Google so I'm not sure what to make of it.
I was able to generate an access token by adding a Client at
https://accounts.zoho.com/developerconsole and creating a grant token with the ... Self client option. I chose the scope ZohoCRM.modules.all and ran this code to get an access token:
- $oAuthClient = ZohoOAuth::getClientInstance();
- $grantToken = "1000.fab4b0ebce99ae77598d6dd3da422f98.d874ba2987fe1cbe3bae9f4141cd7310"; // ZohoCRM.modules.all
- try {
- $oAuthTokens = $oAuthClient->generateAccessToken($grantToken);
- }
- catch (Exception $e) {
- echo '<pre>Could not get access token: '.$e->getMessage()."\n";
- echo '$grantToken = '.$grantToken."\n";
- }
Once I have that access token I attempt to run this code:
- $zcrmModuleIns = ZCRMModule::getInstance("Leads");
- $bulkAPIResponse = $zcrmModuleIns->getRecords();
- $recordsArray = $bulkAPIResponse->getData(); // $recordsArray - array of ZCRMRecord instances
And that is when the error is generated.
Thanks for the help!