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

SESSION HIJACKING

Blog banner

gis substation

Blog banner

Dangers of Using Public WiFis

Blog banner

differentiate thinking humanly and rationally

Blog banner

Social Engineering Deceptions and Defenses

Blog banner

PPC Advertising and its Impressive Benefits

Blog banner

Malware

Blog banner

internet email and it's applications

Blog banner

CYBER SECURITY CHALLENGES

Blog banner

This too shall pass

Blog banner

Race Condition in Operating Theatre

Blog banner

Student Grade Calculator in LISP

Blog banner

Virtual Machine

Blog banner

Service Operations in ITSM

Blog banner

MULTITHREADING:ENHANCEING PERFORMANCE AND EFFICIENCY IN COMPUTING

Blog banner

Procedure For Corporate High-Tech Investigations

Blog banner

Cybersecurity Standards for Automotive

Blog banner

Threat management

Blog banner

Classification Vs Clustring? What's the diffrence?

Blog banner

BLOCKCHAIN MACHANISM

Blog banner

Data Science in Everyday Life (like a phone, shopping cart, or social media icons)

Blog banner

Microsoft Windows Overview

Blog banner

Operating system

Blog banner

Mobile Security

Blog banner

Developments in Modern Operating Systems

Blog banner

What is Packet Filtering?

Blog banner

Virtual Machine

Blog banner

Understanding Univariate, Bivariate, and Multivariate Analysis in Data Science

Blog banner

Networking 101: How to Build Meaningful Connections in College

Blog banner

Every body is beautiful

Blog banner

FREE VERSION OF G-MAIL

Blog banner

INTERRUPTS

Blog banner

Evolution of Operating Systems

Blog banner

How to feel Happy everyday day

Blog banner

Riddhi Miyani 53003220140

Blog banner

Paginng In OS

Blog banner

Understanding Regression Analysis

Blog banner

Data Mining

Blog banner

10 Reasons Why Guy BestFriends are the Must in Every Girl's Life

Blog banner

Importance of Education

Blog banner

bulk email software

Blog banner

BrainGate Technology

Blog banner