0
我正在探索Zoho-invoice API並嘗試與我的應用程序集成。但我卡住了,無法找出是什麼原因。與ZOHO發票集成
請幫助:
我這是怎麼調用API:
$fields = array(
'contact_name' => urlencode([name]),
'billing_address' => array('address' => urlencode([address]), 'city' => urlencode([city]), 'state' => urlencode([state]), 'zip' => urlencode([pincode]), 'country' => urlencode([country])),
'contact_person_id' => urlencode([id]),
'email' => urlencode([email])
);
$jsonData = json_encode($fields);
//Initialize connection
$ch = curl_init("https://invoice.zoho.com/api/v3/contacts?authtoken=[authtoken]&organization_id=[id]&JSONString={$jsonData}");
curl_setopt($ch, CURLOPT_VERBOSE, 1);//standard i/o streams
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);// Turn off the server and peer verification
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);//Set to return data to string ($response)
curl_setopt($ch, CURLOPT_POST, TRUE);//Regular post
//Execute cUrl session
$response = curl_exec($ch);
curl_close($ch);
我發送正確的身份驗證令牌和組織關鍵。
但我得到這個錯誤響應:
"code":1048,"message":"Sorry, there was an internal error. Please contact [email protected] for assistance."
任何幫助將不勝感激。謝謝
使用$信息= curl_getinfo($ CH);然後回顯'
';並查看狀態和錯誤! – user2727841