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

"Audit" In Data Science

Blog banner

Virtual memory

Blog banner

Cache Memory(142)

Blog banner

Busted : Common Web Security Myths

Blog banner

Virtual memory

Blog banner

Zomato's Secret Digital Marketing Techniques!

Blog banner

My Favorite Sportsperson

Blog banner

Data is an asset and it is your responsibility!

Blog banner

The Real Reason Patola Outfits Come at a Premium Cost

Blog banner

memory management

Blog banner

Cyber Forensics on IOT Devices

Blog banner

SQL Injection Techniques

Blog banner

Why Moms Are Choosing Customised School Accessories Over Generic Products?

Blog banner

Stephen Hawking : A Remarkable Physicist

Blog banner

Concurrency and Deadlocks

Blog banner

How To Implement Search Engine Marketing (Sem) Strategy Effectively

Blog banner

What is process

Blog banner

Know your Processors!

Blog banner

How Preschools Help Children Make Their First Friends

Blog banner

MODERN OPERATING SYSTEM

Blog banner

Is Social Media Marketing The Next Wave Of Digital Marketing?

Blog banner

PROCESS STATE:

Blog banner

Deadlock

Blog banner

Software

Blog banner

Building a Better You: Fitness Tips and Inspiration.

Blog banner

Koinex is shutting down and here is how you can withdraw...

Blog banner

SmartData Collective: Data Science aur Analytics ki Duniya

Blog banner

Memory Management

Blog banner

ARTICAL ON MANAGEMENT SYSTEM

Blog banner

Game via listing method

Blog banner

How social media affect

Blog banner

Understanding the 4 Types of Learning Methods in Early Childhood

Blog banner

Consumer to consumer business mode

Blog banner

Data Visualization

Blog banner

Maharashtrian culture: Tradition, Art, Food

Blog banner

Interrupts - Types, Working & Importance

Blog banner

Explain the concept of ( MIS) Management information systems

Blog banner

File management

Blog banner

Socket Programming in Java

Blog banner

Computer Forensics and its Impact in Business Environment

Blog banner

Khau Galli – Vile Parle

Blog banner

MEMORY MANAGEMENT FILE

Blog banner