I'm getting this response on the api:
- <response><error><code>4834</code><message>Invalid Ticket Id</message></error></response>
It looks like tickets were deprecated, so I'm not sure why I would be getting that. Here's the PHP code
- $xml = '<Leads>';
- $xml .= '<row no="1">';
- $xml .= '<FL val="Lead Source">Source</FL>';
- $xml .= '<FL val="First Name">'.htmlspecialchars($entry['first_name']).'</FL>';
- $xml .= '<FL val="Last Name">'.htmlspecialchars($entry['last_name']).'</FL>';
- $xml .= '<FL val="Email">'.htmlspecialchars($entry['email']).'</FL>';
- $xml .= '</row>';
- $xml .= '</Leads>';
- $url = "https://crm.zoho.com/crm/private/xml/Leads/insertRecords";
- $query = "newFormat=1&authtoken=".$this->zoho_auth_token."&scope=crmapi&xmlData=".urlencode($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);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
- $response = curl_exec($ch);
- curl_close($ch);
- var_dump($response);