PHP cURL insert not working

PHP cURL insert not working

Hello Everyone,

I was trying the insert example. Code is not inserting the lead into the zoho crm and also not giving any error. Can anyone please help.

Thanks in advance.

Here is the code - what's wrong in there?
  1. <?php
  2.   //Initialize connection 
  3.   $ch = curl_init('https://crm.zoho.com/crm/private/xml/Leads/insertRecords?');
  4.   curl_setopt($ch, CURLOPT_VERBOSE, 1);//standard i/o streams 
  5.   curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);// Turn off the server and peer verification 
  6.   curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); 
  7.   curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);//Set to return data to string ($response) 
  8.   curl_setopt($ch, CURLOPT_POST, 1);//Regular post 
  9.   //Set post fields 
  10.   //this script is being proccessed by a form so I also put all of my $_POST['name'] variable here to be 
  11.   //used in the $xmlData variable below

  12.   $authtoken = "...xxx...";
  13.   $xmlData = "<Leads><row%20no=\'1\'><FL%20val=\'Company\'>Neo%20Group</FL><FL%20val=\'First%20Name\'>Praveen</FL><FL%20val=\'Last%20Name\'>Gupta</FL><FL%20val=\'Email\'>praveen@neogroup.com</FL><FL%20val=\'Lead%20Source\'>GSRM%20Website</FL></row></Leads>";

  14.   $query = "newFormat=1&authtoken={$authtoken}&scope=crmapi&xmlData={$xmlData}"; 
  15.   curl_setopt($ch, CURLOPT_POSTFIELDS, $query);// Set the request as a POST FIELD for curl. 
  16.   //Execute cUrl session 
  17.   $response = curl_exec($ch); 
  18.   curl_close($ch);
  19. ?>