【发布时间】:2018-12-10 14:04:38
【问题描述】:
我有 $code 和其他变量值,但我收到错误“发生服务器错误看起来您输入了不正确的地址或您单击的 URL 无效。”
$adminUrl='https://accounts.zoho.com/oauth/v2/token';
$data = array("code" => $code,
"redirect_uri" => $redirect_url,
"client_id"=>$client_id,
"client_secret" =>$client_secret,
"grant_type"=> "authorization_code",
"scope" => "ZohoCRM.modules.ALL");
$data_string = json_encode($data,JSON_UNESCAPED_SLASHES);
$headers = array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data_string)
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $adminUrl);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
$token = curl_exec($ch);
【问题讨论】:
-
您好,您解决了这个问题吗?我遇到了同样的错误