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

The Role of cryptography in cyber security

Blog banner

AOL Mail

Blog banner

Design Considerations for Disk Cache Management

Blog banner

A Traveller’s Guide to Offbeat Places in Arcadia, Florida

Blog banner

Bulk E-mail software

Blog banner

Deadlock and Starvation in an Operating System

Blog banner

Memory Management

Blog banner

Review on Cyber Forensics and its Analysis Tools

Blog banner

Linux VServer Architecture

Blog banner

Virtual Machine

Blog banner

What is a Dumpster Diving Attack?

Blog banner

Types Of scheduling

Blog banner

semaphores

Blog banner

"Life as a Part-time Student"

Blog banner

OS Assignment 3 Deadlock

Blog banner

Virtual Machine

Blog banner

Big Data Architecture

Blog banner

Vulnerabilities in OnePlus Devices

Blog banner

OPERATING SYSTEM OBJECTIVES AND FAULT TOLERENCE.

Blog banner

Time Series Analysis

Blog banner

Modern operating system

Blog banner

Article on Fresh Book

Blog banner

Modern Operating System - Khush Bagaria

Blog banner

File Sharing

Blog banner

INTERNET

Blog banner

A BLOG ON MYSQL

Blog banner

S-Tool : Steganography

Blog banner

WHAT IS SNAPCHAT AND HOW DOES IT WORK?

Blog banner

GIS Mapping

Blog banner

Interrupts in OS

Blog banner

Article on Team Work

Blog banner

Characteristics of Etherum

Blog banner

What is Packet Filtering?

Blog banner

Direct Memory Access

Blog banner

Social Engineering Deceptions and Defenses

Blog banner

How to make Pancakes

Blog banner

What is 'Multi-core and Multi-threading' ?

Blog banner

security requirements for safe e-payment

Blog banner

TRIGGERS IN DATABASE

Blog banner

“Shot on iPhone” : A campaign by Apple that turned into a prodigy

Blog banner

Top 4 Places To Stay In Copenhagen

Blog banner

Understanding Mobile Device Forensics

Blog banner