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

Gamer life

Blog banner

“CONSISTENCY” in Social Media Marketing

Blog banner

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

Blog banner

An Overivew Of Cache Memory

Blog banner

RAID

Blog banner

A-B-C of Networking: Part-3 (Topology [Bus & Star])

Blog banner

Virtual Memory

Blog banner

A MODERN OPERATING SYSTEM

Blog banner

Teenagers of Today

Blog banner

A Survey of Anti-Forensic Techniques: Methods, Challenges, and Countermeasures

Blog banner

From Loom to Luxury: How Patola Elevates Modern Wardrobes

Blog banner

Modern Operating system

Blog banner

Beatbox

Blog banner

INTERNET SECURITY

Blog banner

The Future of Cybersecurity: Trends, Challenges, and Strategies

Blog banner

Tableau

Blog banner

From Model Mistakes to Metrics

Blog banner

Install Ubuntu in Vmware

Blog banner

Direct Memory Access

Blog banner

Raising Emotionally Intelligent Students: The Classroom Beyond Academics

Blog banner

World’s rarest passport owned by 500 people.

Blog banner

Modern operating system

Blog banner

Data Science in Predictive Analytics: Transforming Business Decision-Making

Blog banner

10 Reasons to Date a South Indian Girl

Blog banner

SECURITY TOOLS

Blog banner

New Ransomware Encrypts Your Android And Then Changes PIN Lock

Blog banner

MY MOST THRILLED TREK ..... BHAIRAVGAD

Blog banner

Number Guessing game --lisp

Blog banner

Data-Driven Prediction of Virtual Item Prices in Online Games

Blog banner

Review on Cyber Forensics and its Analysis Tools

Blog banner

RAID - LEVELS OF RAID

Blog banner

Improving the Accuracy of GPS and GNSS

Blog banner

Image Steganography: Hiding Secrets in Plain Sight

Blog banner

Why is it hard to design an Operating Systems ?

Blog banner

OPERATING SYSTEM

Blog banner

Memory Management of Operating System(OS)

Blog banner

Ola

Blog banner

Outlook mail

Blog banner

A Deep Dive

Blog banner

Royal enfield

Blog banner

Craziness of dream 11 and how it impacts on our life

Blog banner

Health is Wealth

Blog banner