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
2585 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

MOBILE DEVICE FORENSIC

Blog banner

Social Media.

Blog banner

Memory Management

Blog banner

How International Schools Build Global-Minded Students through Curriculum & Activities

Blog banner

Life

Blog banner

IT GOVERNANCE

Blog banner

What is OS Fingerprinting?

Blog banner

Satellite Based Positioning

Blog banner

What Makes Patola the Queen of Silk?

Blog banner

Data Security must be your Priority!

Blog banner

What Are Electro-Forged Gratings? Benefits, Applications, and Why Industries Prefer Them

Blog banner

RAID and It's Levels

Blog banner

Deadlock

Blog banner

How to invest in Indian Stock Market ? ~ Tutorial 1

Blog banner

Uniprocessor and Types

Blog banner

All you need to know about “Off-page SEO”

Blog banner

John Titor: The Time Traveler

Blog banner

A Journey By Train

Blog banner

Microsoft Word

Blog banner

Southern Turkey Earthquake: Causes and Consequences of a Tragic Natural Disaster

Blog banner

Best password managers: Reviews of the top products

Blog banner

OS DESIGN CONSIDERATIONS FOR MULTIPROCESSOR

Blog banner

Tableau

Blog banner

The Role of Fibre in Everyday Nutrition and Digestive Health

Blog banner

Importance Of Education.

Blog banner

Best Time to Visit Arcadia, Florida & Why Oak Tree Hotel Is Always Ready

Blog banner

CONCURRENCY

Blog banner

Session Hijacking

Blog banner

A Miracle Toothpaste for Cavity Reversal is a Total Scam

Blog banner

Texting is actually better than talking in person

Blog banner

Starvation

Blog banner

Why Extreme Opinions Are Rising: Psychological Insights into Society’s Divides

Blog banner

Pandas Matrix Applications

Blog banner

5 Powerful Mindset Shifts To Make 2026 Your Breakthrough Year

Blog banner

child Labour

Blog banner

Guidelines for a Low sodium Diet.

Blog banner

BEAUTY IS IN THE EYE OF THE BEHOLDER

Blog banner

"Can Lisp do Machine Learning?"

Blog banner

MORDERN UNIX SYSTEM

Blog banner

Juveniles, Internet and Computer Crime

Blog banner

Game via listing method

Blog banner

Deadlocks in Operating Systems

Blog banner