Hi,
I would like to know if first, is it possible to call this URL with cURL PHP
url = https://accounts.zoho.com/oauth/v2/auth?scope=ZohoCRM.users.ALL&client_id={client_id}
&response_type=code&access_type={"offline"or"online"}&redirect_uri={redirect_uri}
Note: I know for a fact the URL is working. If I copy and paste it in the
browser
, everything is fine.
If it's possible, can someone tell me why my cURL call is not working and keep returning me this error
Uh, oh!
Server error occurred
Looks like you typed an incorrect address
Or
the URL you clicked is invalid.
If you still feel the URL is correct, please send us a mail to support@zohoaccounts.com
This is my current cURL PHP call
$uri = 'https://*********.ca/***/***.php?cmdAction=grantcode';
$scope = 'ZohoCRM.modules.contacts.ALL';
$clientid = '1***.N***********************';
$accestype = 'online';
$ch = curl_init();
$url = 'https://accounts.zoho.com/oauth/v2/auth?scope=' . $scope . '&client_id=' . $clientid . '&response_type=code&access_type=' . $accestype . '&redirect_uri=' . $uri . '';
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "");
curl_setopt($ch, CURLOPT_POSTREDIR, CURL_REDIR_POST_ALL);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_MAXREDIRS, 5);
curl_exec($ch);
curl_close($ch);
Thank you !