我有一個PHP集成到zohoCRM從web表單插入線索到系統。突然之間,這些表單不再工作,並且Zoho錯誤信息中沒有有用的調試信息。下面的代碼:Zoho通過PHP的CRM主導插入
$xml = '<?xml version="1.0" encoding="UTF-8"?>'; // same error with or without this line
$xml .= '<Leads>';
$xml .= '<row no="1">';
if(isset($fname)) $xml .= '<FL val="First Name">'.$fname.'</FL>';
if(isset($lname)) $xml .= '<FL val="Last Name">'.$lname.'</FL>';
if(isset($post['sender_email'])) $xml .= '<FL val="Email">'.$post['sender_email'].'</FL>';
$xml .= '<FL val="Lead Source">Web Research</FL>';
if(isset($phone)) $xml .= '<FL val="Phone">'.$phone.'</FL>';
$xml .= '<FL val="Description">'.$comments.'</FL>';
$xml .= '</row>';
$xml .= '</Leads>';
/*
var_dump($xml) returns:
<?xml version="1.0" encoding="UTF-8"?><Leads><row no="1"><FL val="First Name">Joe</FL><FL val="Last Name">Smith</FL><FL val="Email">[email protected]</FL><FL val="Lead Source">Web Research</FL><FL val="Phone">123-456-5678</FL><FL val="Description">My comments</FL></row></Leads>
*/
$url ="https://crm.zoho.com/crm/private/xml/Leads/insertRecords";
$query="authtoken=validtoken&scope=crmapi&newFormat=1&xmlData=".$xml;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $query);// Set the request as a POST FIELD for curl.
//Execute cUrl session
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
// returns 4600 Unable to process your request. Please verify if the name and value is appropriate for the "xmlData" parameter.
好像不管我怎麼努力(我已經嘗試了一大堆的最多的一天),我不能得到比這沒用4600
錯誤的任何其他。有沒有人遇到過這個?
不要他們有一個文檔,也許他們的輸入格式改變什麼 – 2013-04-24 19:56:00
@Pekka웃 - ?是的,他們確實有文檔,但據我所知,系統是完全相同的,它甚至默認使用API的「版本1」,它應該是向後兼容的。在他們的論壇中有很多像我的問題,沒有真正的解決方案,所以我想我會嘗試SO。 – user101289 2013-04-24 19:59:06
你能否更新你的代碼,以便我們看到答案如何幫助解決這個問題? – 2014-03-19 08:29:01