【问题标题】:Open Activities - New Event - Zoho CRM API开放活动 - 新活动 - Zoho CRM API
【发布时间】:2017-08-28 22:16:12
【问题描述】:

我正在尝试通过 API 向潜在客户添加新事件(开放活动 --- 新事件,请参阅随附的图片以供参考)。我可以创建一个事件,但不能创建一个开放活动 - 与潜在客户关联的新事件。

          //Initialize connection 
          $ch = curl_init('https://crm.zoho.com/crm/private/xml/Events/updateRecords?'); 
          // insertRecords instead updateRecords works fine but as informed before it creates only event just
          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 
          //Set post fields 
          //this script is being proccessed by a form so I also put all of my $_POST['name'] variable here to be 
          //used in the $xmlData variable below

          $authtoken = " f12ccd3daa030d2980b61d85d4824abf";
          $xml_data  = '<Events>'; 
            $xml_data .= '<row no="1">';
            $xml_data .= '<FL val="Subject">Subject of your choice</FL>';
            $xml_data .= '<FL val="Start DateTime">'.date('Y-m-d H:i:s').'</FL>';
            $xml_data .= '<FL val="End DateTime">'.date('Y-m-d H:i:s').'</FL>';
            $xml_data .= '<FL val="Venue">Mohanty</FL>';
            $xml_data .= '<FL val="Send Notification Email">false</FL>';
            $xml_data .= '</row>';
            $xml_data .= '</Events>';

          $query = "authtoken=$authtoken&scope=crmapi&newFormat=1&id=2739523000000127005&xmlData=$xml_data"; // id --- is the lead id
          curl_setopt($ch, CURLOPT_POSTFIELDS, $query);// Set the request as a POST FIELD for curl. 
          //Execute cUrl session 
          $response = curl_exec($ch); 
          print_r($response);
          curl_close($ch);

【问题讨论】:

    标签: php curl crm zoho


    【解决方案1】:
    //Initialize connection 
              $ch = curl_init('https://crm.zoho.com/crm/private/xml/Events/insertRecords?'); 
              // insertRecords will only work to create events
              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 
              //Set post fields 
              //this script is being proccessed by a form so I also put all of my $_POST['name'] variable here to be 
              //used in the $xmlData variable below
    
              $authtoken = "your auth token";
              $xml_data  = '<Events>'; 
                $xml_data .= '<row no="1">';
                $xml_data .= '<FL val="Subject">Subject of your choice</FL>';
                $xml_data .= '<FL val="Start DateTime">'.date('Y-m-d H:i:s').'</FL>';
                $xml_data .= '<FL val="End DateTime">'.date('Y-m-d H:i:s').'</FL>';
                $xml_data .= '<FL val="Venue">Mohanty</FL>';
                $xml_data .= '<FL val="Send Notification Email">false</FL>';
                $xml_data .= '<FL val="SEMODULE">Leads</FL>'; // missing mapping module
                $xml_data .= '<FL val="SEID">LEAD ID</FL>'; // missing seid which is lead id
                $xml_data .= '</row>';
                $xml_data .= '</Events>';
    
              $query = "authtoken=$authtoken&scope=crmapi&newFormat=1&xmlData=$xml_data"; 
              curl_setopt($ch, CURLOPT_POSTFIELDS, $query);// Set the request as a POST FIELD for curl. 
              //Execute cUrl session 
              $response = curl_exec($ch); 
              print_r($response);
              curl_close($ch);
    

    这将有助于映射和创建事件。

    【讨论】:

      猜你喜欢
      • 2013-05-08
      • 1970-01-01
      • 1970-01-01
      • 2018-04-11
      • 1970-01-01
      • 2017-09-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多