gpt4 book ai didi

php - Zoho CRM :STUCK on Step 3: Generate Access Token and Refresh Token

转载 作者:行者123 更新时间:2023-12-05 06:29:17 25 4
gpt4 key购买 nike

我有 $code 和其他变量值,但我收到错误消息“发生服务器错误看起来你输入了错误的地址或者你点击的 URL 无效。”

enter image description here

$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);

最佳答案

//请记住根据您的 zoho 帐户更改值/url。

获取客户端 ID 和 secret ID:https://accounts.zoho.com/developerconsole

一旦我们有了 client-id ,我们将使用它来生成 oauth_token ( access_token )。

您将需要下面给出的 2 个文件来获取 oath_token(也称为 access_token)。

文件_1 (zohoauth.php)

https://drive.google.com/file/d/1yOfPBllcL3KEKIm_ooDxLJzc8a4NCDIu/view?usp=sharing

文件_2 ( testaccesstoken.php )

https://drive.google.com/file/d/1fBxBbt7IKI7vwgx6inaDnjtylSlSe4ye/view?usp=sharing

关于php - Zoho CRM :STUCK on Step 3: Generate Access Token and Refresh Token,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53707341/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com