2017-08-28 14 views
0

represents crm place for new event that I would like to create using code APIを使用して新しいイベントをリードに追加しようとしています(オープンアクティビティ---新しいイベント、添付の画像を参照してください)。私はイベントを作成することはできますが、オープンアクティビティ - 鉛に関連付けられた新しいイベントは作成できません。オープンアクティビティ - 新しいイベント - Zoho CRM 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); 

答えて

0
//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); 

これは、マッピングに役立つとイベントを作成します。

関連する問題