Create products using api
Hello,
I am trying to create products using api and curl PHP but i am not able
to create.
Please guide me where i am doing wrong.
Here my code:
$xml = '<?xml version="1.0" encoding="UTF-8"?>
<Products>
<FL val="Product Name">Testttt Prrr</FL>
<FL val="Product Owner">Alice Heijbel</FL>
<FL val="Unit Price">10.0</FL>
<FL val="Qty Ordered">1.0</FL>
</Products>';
$auth="**********";
$url ="
https://crm.zoho.eu/crm/private/xml/Products/insertRecords";
$query="newFormat=1&authtoken=".$auth."&scope=crmapi&xmlData=".$xml;
$ch = curl_init();
/* set url to send post request */
curl_setopt($ch, CURLOPT_URL, $url);
/* allow redirects */
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
/* return a response into a variable */
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
/* times out after 30s */
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
/* set POST method */
curl_setopt($ch, CURLOPT_POST, 1);
/* add POST fields parameters */
curl_setopt($ch, CURLOPT_POSTFIELDS, $query);// Set the request as
a POST FIELD for curl.
//Execute cUrl session
$response = curl_exec($ch);
curl_close($ch);
echo '<pre>';print_r($response);
I'ts not creating products.
Please reply asap, it's urgent for me .
Thanks.