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

From Websites To Super Apps For Digital User Experience

Blog banner

Memory Management

Blog banner

Best password managers: Reviews of the top products

Blog banner

ADIDAS

Blog banner

Android Flashlight Application

Blog banner

Race Conditions

Blog banner

Predicting Student Performance with Data Science

Blog banner

Principles of Service Operation

Blog banner

Digital Marketing

Blog banner

Indian Culture and Tradition

Blog banner

virtual memory

Blog banner

Types of Hackers.

Blog banner

The Evolution of the Microprocessor ~ Aditya Pai

Blog banner

What Your Music Taste Reveals About Your Personality

Blog banner

Street foods

Blog banner

Difference Between Classification And Clustering

Blog banner

Google App Engine

Blog banner

PHONE TECHNOLOGY

Blog banner

SMARTSHEET MANAGEMENT SOFTWARE

Blog banner

Swiggi

Blog banner

Human factor, a critical weak point in the information security of an organization’s IOT

Blog banner

Image Steganography: Hiding Secrets in Plain Sight

Blog banner

The Difference Between Plaque and Tartar Explained Simply

Blog banner

Concurrency management in operating systems

Blog banner

How to use open SSL for web server - browser communication

Blog banner

What are Virtual Machines

Blog banner

CSI and Organizational Change

Blog banner

Scala - a programming tool

Blog banner

Deadlock and Starvation

Blog banner

Disk Management

Blog banner

Balance

Blog banner

Memory Management in Operating System

Blog banner

A-B-C of Networking: Part-3 (Topology [Ring, Tree, Mesh])

Blog banner

MEMORY MANAGEMENT REQUIREMENT

Blog banner

Security in Cloud Computing Environment using cryptography - Rushabh Modi

Blog banner

Uniprocessor Scheduling

Blog banner

Things You Should Leave Behind In 2025, Whilst In 2026

Blog banner

Risk management in IT

Blog banner

Memory Management

Blog banner

Virtual memory in windows

Blog banner

Smartsheet

Blog banner

Memory Management

Blog banner