Skip to content

Instantly share code, notes, and snippets.

@akshayvinchurkar
Created May 22, 2019 07:51
Show Gist options
  • Save akshayvinchurkar/4ac84a57cfae9577408d62ecd02c7f19 to your computer and use it in GitHub Desktop.
Save akshayvinchurkar/4ac84a57cfae9577408d62ecd02c7f19 to your computer and use it in GitHub Desktop.
zoho Lead Code
$auth="authkey";
$leadowner = $_POST['lowner'];
$firstName = $_POST['fname'];
$lastName = $_POST['lname'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$url = 'https://crm.zoho.com/crm/private/xml/Leads/insertRecords?';
$post = 'newFormat=1&authtoken='.$auth.'&scope=crmapi&xmlData=<Leads>
<row no="1">
<FL val="Lead Owner">'.$leadowner.'</FL>
<FL val="First Name">'.$firstName.'</FL>
<FL val="Last Name">'.$lastName.'</FL>
<FL val="Email">'.$email.'</FL>
<FL val="Phone">'.$phone.'</FL>
<FL val="Description">Insert ZOHO Lead</FL>
</row>
</Leads>';
//================= start curl ===================
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
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,$post);
$result = curl_exec($ch);
curl_close($ch);
//================= end curl ===================
echo '<pre>';
print_r($result);
exit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment