Getting invalid_code while trying to use PHP SDK v3
Hi to the team.
I think I'm confused in something, but I don't know what : I'm using a Self Client access with a fresh token to make a OAuth request, but it keeps output me invalid_code.
My composer install is OK. The error is bellow :
- com\zoho\crm\api\exception\SDKException Object ( [_message:com\zoho\crm\api\exception\SDKException:private] => invalid_code [_code:com\zoho\crm\api\exception\SDKException:private] => INVALID CLIENT ERROR [_cause:com\zoho\crm\api\exception\SDKException:private] => [_details:com\zoho\crm\api\exception\SDKException:private] => [message:protected] => invalid_code [string:Exception:private] => [code:protected] => 0 [file:protected] => /Users/thomasblanc/Workspace/poc-zoho/vendor/zohocrm/php-sdk/src/com/zoho/api/authenticator/OAuthToken.php [line:protected] => 404 [trace:Exception:private] => Array ( [0] => Array ( [file] => /Users/thomasblanc/Workspace/poc-zoho/vendor/zohocrm/php-sdk/src/com/zoho/api/authenticator/OAuthToken.php [line] => 344 [function] => processResponse [class] => com\zoho\api\authenticator\OAuthToken [type] => -> [args] => Array ( [0] => HTTP/1.1 200 Server: ZGS Date: Wed, 28 Sep 2022 08:58:53 GMT Content-Type: application/json;charset=UTF-8 Content-Length: 24 Connection: keep-alive Set-Cookie: b266a5bf57=57c7a14afabcac9a0b9dfc64b3542b70; Path=/ X-Content-Type-Options: nosniff X-XSS-Protection: 1 Set-Cookie: iamcsr=66589d06-a7b3-49fc-bc29-910deca378e5;path=/;SameSite=None;Secure;priority=high Set-Cookie: _zcsr_tmp=66589d06-a7b3-49fc-bc29-910deca378e5;path=/;SameSite=Strict;Secure;priority=high X-Frame-Options: SAMEORIGIN Content-Language: en-US Strict-Transport-Security: max-age=63072000 {"error":"invalid_code"} ) ) [1] => Array ( [file] => /Users/thomasblanc/Workspace/poc-zoho/vendor/zohocrm/php-sdk/src/com/zoho/api/authenticator/OAuthToken.php [line] => 271 [function] => refreshAccessToken [class] => com\zoho\api\authenticator\OAuthToken [type] => -> [args] => Array ( [0] => com\zoho\crm\api\UserSignature Object ( [email:com\zoho\crm\api\UserSignature:private] => xxxxxx@xxxxxx.xxxx ) [1] => com\zoho\api\authenticator\store\FileStore Object ( [filePath:com\zoho\api\authenticator\store\FileStore:private] => /Users/thomasblanc/Workspace/poc-zoho/php_sdk_token.txt [headers:com\zoho\api\authenticator\store\FileStore:private] => Array ( [0] => user_mail [1] => client_id [2] => refresh_token [3] => access_token [4] => grant_token [5] => expiry_time ) ) ) ) [2] => Array ( [file] => /Users/thomasblanc/Workspace/poc-zoho/vendor/zohocrm/php-sdk/src/com/zoho/crm/api/util/CommonAPIHandler.php [line] => 259 [function] => authenticate [class] => com\zoho\api\authenticator\OAuthToken [type] => -> [args] => Array ( [0] => com\zoho\crm\api\util\APIHTTPConnector Object ( [url:com\zoho\crm\api\util\APIHTTPConnector:private] => https://www.zohoapis.com/crm/v2/Contacts [requestMethod:com\zoho\crm\api\util\APIHTTPConnector:private] => GET [headers:com\zoho\crm\api\util\APIHTTPConnector:private] => Array ( [If-Modified-Since] => 2020-06-02T07:33:06+02:00 ) [parameters:com\zoho\crm\api\util\APIHTTPConnector:private] => Array ( [approved] => both ) [requestBody:com\zoho\crm\api\util\APIHTTPConnector:private] => [contentType:com\zoho\crm\api\util\APIHTTPConnector:private] => ) ) ) [3] => Array ( [file] => /Users/thomasblanc/Workspace/poc-zoho/vendor/zohocrm/php-sdk/src/com/zoho/crm/api/record/RecordOperations.php [line] => 117 [function] => apiCall [class] => com\zoho\crm\api\util\CommonAPIHandler [type] => -> [args] => Array ( [0] => com\zoho\crm\api\record\ResponseHandler [1] => application/json ) ) [4] => Array ( [file] => /Users/thomasblanc/Workspace/poc-zoho/index.php [line] => 96 [function] => getRecords [class] => com\zoho\crm\api\record\RecordOperations [type] => -> [args] => Array ( [0] => Contacts [1] => com\zoho\crm\api\ParameterMap Object ( [parameterMap:com\zoho\crm\api\ParameterMap:private] => Array ( [approved] => both ) ) [2] => com\zoho\crm\api\HeaderMap Object ( [headerMap:com\zoho\crm\api\HeaderMap:private] => Array ( [If-Modified-Since] => 2020-06-02T07:33:06+02:00 ) ) ) ) [5] => Array ( [file] => /Users/thomasblanc/Workspace/poc-zoho/index.php [line] => 105 [function] => getRecord [class] => Record [type] => :: [args] => Array ( ) ) ) [previous:Exception:private] => [xdebug_message] => ( ! ) com\zoho\crm\api\exception\SDKException: invalid_code in /Users/thomasblanc/Workspace/poc-zoho/vendor/zohocrm/php-sdk/src/com/zoho/api/authenticator/OAuthToken.php on line 404 Call Stack #TimeMemoryFunctionLocation 10.0022425928{main}( ).../index.php:0 20.0051489288Record::getRecord( ).../index.php:105 30.03042083368com\zoho\crm\api\record\RecordOperations->getRecords( ).../index.php:96 40.03482269144com\zoho\crm\api\util\CommonAPIHandler->apiCall( ).../RecordOperations.php:117 )
Am i missing something ?