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

AOL Mail

Blog banner

TRIGGERS IN DATABASE

Blog banner

R Programming

Blog banner

What is HTML?

Blog banner

What's Better : Supervised or Unsupervised Learning

Blog banner

Instagram

Blog banner

Uniprocessor scheduling

Blog banner

Exploring Florida Beyond the Obvious Tourist Trails

Blog banner

SWEET SHREDDED MANGO CHUNDA (MANGO CHUNDA)

Blog banner

BrainGate Technology

Blog banner

Concurrency and memory

Blog banner

Knowledge Management in Continual Service improvement (CSI)

Blog banner

Virtual Machine

Blog banner

Water Resources are about to exhaust...

Blog banner

Benefits and drawback of web security.

Blog banner

Deadlock

Blog banner

Virtual Memory

Blog banner

Tableau

Blog banner

Security and E-mail

Blog banner

Social media

Blog banner

TRAIN TRAVELING

Blog banner

Study on cyber and network forensic in computer security management

Blog banner

Why Data Security Is Important

Blog banner

Data Mining

Blog banner

Theads

Blog banner

MENDELEY

Blog banner

INDIAN CHEAPEST COSMETICS BRAND

Blog banner

Working with Sniffers for monitoring network communication

Blog banner

Data Visualization

Blog banner

Disk Management

Blog banner

Linux Threads:

Blog banner

LinkedIn: Watch out for these 7 upcoming updates in 2023

Blog banner

Windows Operating System

Blog banner

Importance of business process documentation

Blog banner

The Future of Web Development in 2026: Trends Every Business Must Know

Blog banner

Memory Management

Blog banner

Understanding Input Based Keylogger Activation Systems: Risks and Mitigation

Blog banner

Fault Tolerance in an Operating System

Blog banner

Pro-Tips On How To Keep your Foot Healthy

Blog banner

Threads

Blog banner

A little bit of salt is all the hash needs!

Blog banner

Senseless Teeths

Blog banner