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

Soak knowledge and level up your intellectual potential!!!

Blog banner

Building a Simple Doctor Appointment System in Common Lisp

Blog banner

Mumbaicha Dabbawalla

Blog banner

Direct Memory Access

Blog banner

Virtual Machine

Blog banner

The Secure Software Development Life Cycle (SDLC)

Blog banner

My Favorite Country

Blog banner

Instagram

Blog banner

Python as a tool for Data science task & project

Blog banner

HACKING MOBILE PLATFORM

Blog banner

Service Catalogue Management

Blog banner

Why Travellers from Miami & Orlando Are Visiting Arcadia for Weekend Getaways?

Blog banner

Which Smartphone Company Has the Largest Market Share in India?

Blog banner

Virus

Blog banner

Tracking Emails & Email Crimes

Blog banner

Threads

Blog banner

NIKE

Blog banner

Virtualization

Blog banner

How Unstructured Play Helps Children Become Creative Thinkers

Blog banner

DEVELOPMENTS LEADING TO MODERN OPERATING SYSTEMS

Blog banner

Hacking

Blog banner

Blog on health and fitness

Blog banner

The application udemy

Blog banner

1.1 basic elements

Blog banner

You Get Everyone, But No One Gets You: The Lonely Side of High Emotional Intelligence

Blog banner

This School Year, Let Their Belongings Come Back Home Too with Our Ultimate Labelling Kit

Blog banner

Race Conditions

Blog banner

memory cache

Blog banner

Memory Management

Blog banner

Why Friendship at Work is Important

Blog banner

Deadlock and Starvation

Blog banner

Raid and levels of raid.

Blog banner

What is M-commerce and how it's work

Blog banner

Top 5 Benefits of Artificial Intelligence

Blog banner

Fossil Hunting 101 at the Peace River, Arcadia, Florida, USA

Blog banner

Toothache at night? What does this mean, and how to cope with it?

Blog banner

E-Cash (Electronic Cash)

Blog banner

I/O Management and Disk Scheduling

Blog banner

History of Money

Blog banner

Deadlocks

Blog banner

The Power of Cyber Forensic in Solving Crimes

Blog banner

Kernel in Operating System

Blog banner