Hi there,
I am working to integrate Zoho Books into myapp (free trial).
Please find below the different steps:
Step 1 (ok) : Registering New Client
(to get Client ID and Client Secret)
Step 2
(ok)
: Generating Grant Token
Step 3 (ok): Generate Access and Refresh Token
Step 4 (ok): Generate Access Token From Refresh Token
Step 6 (KO Erreur): Calling An API
{"code":14,"message":"Invalid value passed for authtoken."}
$res = $this->curlPost( 'https://books.zoho.eu/api/v3/organizations', NULL, ['Authorization'=>'Zoho-authtoken '.$accessTokenObjZoho]);
function curlPost($url, $data=NULL, $headers = NULL) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
if(!empty($data)){
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
}
if (!empty($headers)) {
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
}
$response = curl_exec($ch);
if (curl_error($ch)) {
curl_close($ch);
trigger_error('Curl Error:' . curl_error($ch));
}
curl_close($ch);
return $response;
}
$accessTokenObjZoho = it contains a value generated by refreshtoken
(Format : xxxx.xxxae0xxx5f3f3exxx941d0axxxx3xxd.xxxe7099exxx7xxxx3xxxe1e909xxxxx)
How to resolve this error "
Invalid value passed for authtoken."
And an other question , please, in the authentication step, how can the customer select the desired organization?