wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

How to insert contacts in zoho crm using php

profile
Taha Chatriwala
Dec 16, 2017
0 Likes
0 Discussions
2574 Reads
Today I will be showing you how to insert contact records dynamically in to Zoho CRM using Php. First we will create a basic html form with 2 fields : i.e first-name and last-name
<html> <head> </head> <body> <form action="contacts.php" method="post"> First name: <input type="text" name="fname"> Last name: <input type="text" name="lname"> <input type="submit" value="submit" name="submit"> </form> </body> </html>
The details from this form will get forwarded to the api file which is named as "contacts.php" This Api file contains the following code :  
<?php $firstname=$_POST["fname"]; $Lastname=$_POST["lname"]; $xml = '<?xml version="1.0" encoding="UTF-8"?> <Contacts> <row no="1"> <FL val="First Name">' .$firstname. '</FL> <FL val="Last Name">' .$Lastname. '</FL> </row> </Contacts>'; $auth="**********************"; $url ="https://crm.zoho.com/crm/private/xml/Contacts/insertRecords"; $query="authtoken=".$auth."&scope=crmapi&newFormat=1&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 $response; ?>
Note : In the above code replace the value of the $auth variable with your authorization token given by zoho crm. The below video demonstrate the end users view of the above code. [embedyt] https://www.youtube.com/watch?v=Ij5otelJGDE[/embedyt]

Comments ()


Sign in

Read Next

RAID

Blog banner

Danger assessment in GIS

Blog banner

MY FIRST BLOG?

Blog banner

Security issues in Sensor Networks and gathering admissible evidence in Network Forensics

Blog banner

Session Hijacking Techniques

Blog banner

File management

Blog banner

Improving the Accuracy of GPS and GNSS

Blog banner

Compromising Mobile Platforms

Blog banner

Senseless Teeths

Blog banner

Deadlock in Operating systems

Blog banner

Cyber Forensic in the Banking sector

Blog banner

Security in Cloud Computing Environment using cryptography - Rushabh Modi

Blog banner

File and File System Structure

Blog banner

KEAP MANAGEMENT SYSTEM

Blog banner

Pandas Matrix Applications

Blog banner

Direct Memory Access

Blog banner

Race Condition in Operating Theatre

Blog banner

Business Engineering

Blog banner

How to Conquer Depression ?

Blog banner

Esri India launches Policy Maps.

Blog banner

APACHE KAFKA

Blog banner

E-learning in today's world

Blog banner

Threads

Blog banner

Deadlock and Starvation

Blog banner

Deadlock and Starvation

Blog banner

Why Oak Tree Hotel Is Arcadia’s Hidden Gem?

Blog banner

10 Reasons Why Guy BestFriends are the Must in Every Girl's Life

Blog banner

Google classroom

Blog banner

Disk Management

Blog banner

Service transistion under difficult conditions

Blog banner

Privacy LAWs in IT

Blog banner

How To Secure Operating Systems ?

Blog banner

The Rich Heritage Of Patola Sarees: Gujarat’s Timeless Weaving Art

Blog banner

Embedded Operating System

Blog banner

WHAT IS TWITTER AND HOW DOES IT WORK

Blog banner

How to tie a Tie

Blog banner

The Future of Patola Weaving in a Sustainable Fashion World

Blog banner

Goa Trip With Friends

Blog banner

Deadlock

Blog banner

Trends that began during the pandemic

Blog banner

Security issues

Blog banner

Direct memory access

Blog banner