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

PERSONALITY DEVELOPMENT

Blog banner

Finding Meaning, and Identity : Understanding Existential Concerns and Mental Well-being

Blog banner

Race condition

Blog banner

GIS in Mapping and landslide alert in Bangladesh

Blog banner

WomenEmpowerment

Blog banner

Threads

Blog banner

PHONE TECHNOLOGY

Blog banner

Child labour

Blog banner

Admissions Open: Why This Is the Right Time to Choose the Best School for Your Child

Blog banner

Zomato (Income Sources)

Blog banner

Importance Of Time

Blog banner

OLA

Blog banner

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

Blog banner

Deadlock in operating system

Blog banner

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

Blog banner

INTERNET SECURITY

Blog banner

Nature’s Brush on Silk: The Secret Behind Patola Colours

Blog banner

operating system

Blog banner

Importance of Network Security Risk

Blog banner

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

Blog banner

AI and Cyber Security

Blog banner

Whatsapp Messenger

Blog banner

Four Stalls Every Vegetarian Needs To Eat At Outside Vile Parle Station

Blog banner

How Men and Women Process Pain Differently

Blog banner

Why Personalized Return Gifts Are the Perfect Choice for Every Kid’s Birthday Party?

Blog banner

Smart Homes | Zigbee Alliance

Blog banner

Processes : Process description and control

Blog banner

Dangers of Using Public WiFis

Blog banner

Why Your Child Cries at Drop-Off and How Preschools Handle It Gently

Blog banner

I/O Management and Disk Scheduling

Blog banner

Asana

Blog banner

How to kiss

Blog banner

Os assignment

Blog banner

Social Media.

Blog banner

LISP - Library Management System

Blog banner

Deadlock Prevention

Blog banner

DEVELOPMENTS LEADING TO MODERN OPERATING SYSTEMS

Blog banner

Rules and Regulations of Networking: "Standards and Protocols" - Part 2

Blog banner

Meshoo

Blog banner

The New Classic: Indo Western Patola Outfits for Today’s Woman

Blog banner

OS Assignment 3

Blog banner

Hey Aryan here

Blog banner