【问题标题】:Zoho crm API sometimes returns errorZoho crm API 有时会返回错误
【发布时间】:2016-10-09 23:22:50
【问题描述】:

我正在尝试使用 Zoho CRM API 搜索记录,但有时会收到以下错误:

Array ( [response] => Array ( [error] => Array ( [message] => Unable 处理您的请求。请验证您是否输入正确 方法名称、参数和参数值。 [代码] => 4600 ) [uri] => /crm/private/json/Contacts/searchRecords))

我的问题是有时一切正常,有时我会收到此错误

define("TARGETURL", "https://crm.zoho.com/crm/private/json/Contacts/searchRecords");
$parameter = array(
            'scope' => 'crmapi',
            'authtoken' => AUTHTOKEN,
            'selectColumns' => 'All',
            'criteria' => '(Account Name:'.$accountName.')',
            'fromIndex' => $fromIndex,
            'toIndex' => $toIndex
            );
$ch = curl_init();
            curl_setopt($ch, CURLOPT_URL, TARGETURL);
            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, $parameter);
            $result = curl_exec($ch);
            curl_close($ch);

【问题讨论】:

    标签: api crm zoho


    【解决方案1】:

    尝试使用双引号搜索字段,以下是从主要模块搜索电子邮件的脚本。

    $xmlData = "(Email:$email)"; $ch = curl_init('https://crm.zoho.com/crm/private/xml/Leads/searchRecords'); 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, 1); //Set to return data to string ($response) curl_setopt($ch, CURLOPT_POST, 1); //Regular post $authtoken = "********************************"; $query = "authtoken=" . $authtoken . "&scope=crmapi&criteria=" . $xmlData; curl_setopt($ch, CURLOPT_POSTFIELDS, $query); // Set the request as a POST FIELD for curl. $response = curl_exec($ch); curl_close($ch);

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-01-20
      • 2023-03-03
      • 2019-05-25
      • 2019-11-04
      • 2020-09-20
      • 2014-04-04
      • 1970-01-01
      相关资源
      最近更新 更多