New Developer - Invalid Ticket ID 4834

New Developer - Invalid Ticket ID 4834

Hi All,

Im relatively new to Zoho and I am working on using the insertRecord API.

My issue is the below code returns an Invalid Ticket ID 4383

My Auth token is valid and appears in the Active Auth Tokens
  1. $xml = '<Leads>';
  2. $xml .= '<row no="1">';
  3. $xml .= '<FL val="Company">' . $company . '</FL>';
  4. $xml .= '<FL val="First Name">'.$first.'</FL>';
  5. $xml .= '<FL val="Last Name">'.$surname.'</FL>';
  6. if($title) {
  7. $xml .= '<FL val="Designation">' . $title . '</FL>';
  8. }
  9. $xml .= '<FL val="Email">'.$email.'</FL>';
  10. if($tel) {
  11. $xml .= '<FL val="Phone">' . str_replace(' ', '', $tel) . '</FL>';
  12. }

  13. $xml .= '<FL val="Lead Source">Website</FL>';
  14. if($type) {
  15. $xml .= '<FL val="Industry">' . $type . '</FL>';
  16. }
  17. $xml .= '</row>';
  18. $xml .= '</Leads>';

  19.                                 $url ="https://crm.zoho.com/crm/private/xml/Leads/insertRecords";
  20. $query="authtoken=MYVALIDTOKENHERE&scope=crmapi&newFormat=1&xmlData=".$xml;
  21. $ch = curl_init();
  22. curl_setopt($ch, CURLOPT_URL, $url);
  23. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  24. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  25. curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  26. curl_setopt($ch, CURLOPT_POST, 1);
  27. curl_setopt($ch, CURLOPT_POSTFIELDS, $query);// Set the request as a POST FIELD for curl.

  28. //Execute cUrl session
  29. $response = curl_exec($ch);
  30. curl_close($ch);

  31. print_r($response);
Any help will be greatly appreciated.

Steve