Purpose
You can use the insertRecords method to insert records into the required Zoho CRM module.
Important: Use the POST method to pass these parameters instead of GET method.
Request URL
XML Format: http://crm.zoho.com/crm/private/xml/Leads/insertRecords?newFormat=1&apikey=API key&ticket=Ticket
Request Parameters
| Parameter | Data Type | Description |
| ticket* | String | - |
| apikey* | String | Specify API key of your Zoho CRM account
|
| xmlData* | XML | This is an XML string and the format should be same as of getRecords in XML format of fetched records |
| wfTrigger | Boolean
| Set value as true to trigger the workflow rule while inserting record into CRM account. By default, this parameter is false. |
| duplicateCheck | Integer
| Set value as "1" to check the duplicate records and throw an error response or "2" to check the duplicate records, if exists, update the same. |
| isApproval | Boolean
| By default, records are inserted directly . To keep the records in approval mode, set value as true. You can use this parameters for Leads, Contacts, and Cases module. |
| newFormat* | Integer
| newFormat=1: To exclude fields with "null" values while inserting data from your CRM account. newFormat=2: To include fields with "null" values while inserting data from your CRM account.
|
* - Mandatory parameter
Duplicate Check Fields
Module Name
| Duplicate Check Field
|
Leads
| Email |
Contacts
| Email |
Accounts
| Account Name |
Potentials
| Potential Name |
Campaigns
| Campaign Name |
Cases
| Subject |
Products
| Product Name |
Vendors
| Vendor Name |
Quotes
| Subject |
SalesOrders
| Subject |
PurchaseOrders
| Subject |
Invoices
| Subject |
Additional Notes
- While inserting data to your Zoho CRM account, role-based security (Roles, Profiles, Field-level security and Data sharing rules) is applied. Hence, use the user ID with highest role (Ex: CEO) and profile (Ex: Administrator). Also make sure all fields are enabled in the Field-level security settings. For role-based security settings, see Security Administration while generating API Ticket.
- While inserting data, make sure the date and time are in the MM/dd/yyyy and yyyy-MM-dd HH:mm:ss formats respectively
Examples
Insert records into Zoho CRM from third-party applications
URL Format: http://crm.zoho.com/crm/private/xml/Leads/insertRecords?newFormat=1&apikey=APIKEY&ticket=TICKET&xmlData=XMLDATA
XMLDATA example:
<Leads> <row no="1"> <FL val="Lead Source">Web Download</FL> <FL val="First Name">contacto 1</FL> <FL val="Last Name">apellido</FL> <FL val="Email">testing@testing.com</FL> <FL val="Title">Manager</FL> <FL val="Phone">1234567890</FL> <FL val="Home Phone">0987654321</FL> <FL val="Other Phone">1212211212</FL> <FL val="Fax">02927272626</FL> <FL val="Mobile">292827622</FL> </row> </Leads> |
Sample Lead XMLDATA
| <Leads> <row no="1"> <FL val="SMOWNERID">2000000016714</FL> <FL val="Lead Owner">Scott</FL> <FL val="Company">Zoho</FL> <FL val="First Name">Peter</FL> <FL val="Last Name">John</FL> <FL val="Designation">CEO</FL> <FL val="Email">john@test.com</FL> <FL val="Phone">04422334455</FL> <FL val="Fax">98889</FL> <FL val="Mobile">09999999999</FL> <FL val="Website">www.sample.com</FL> <FL val="Lead Source">External Referral</FL> <FL val="Lead Status">Contacted</FL> <FL val="Industry">Financial Services</FL> <FL val="No of Employees">100</FL> <FL val="Annual Revenue">100.0</FL> <FL val="CAMPAIGNID">2000000018007</FL> <FL val="Campaign Source">Sample Campaign</FL> <FL val="Email Opt Out">true</FL> <FL val="Skype ID">peter</FL> <FL val="Salutation">Mr.</FL> <FL val="Street">Street One</FL> <FL val="City">Chennai</FL> <FL val="State">Tamil Nadu</FL> <FL val="Zip Code">6000001</FL> <FL val="Country">India</FL> <FL val="Description">Sample Description.</FL> </row> </Leads> |
Sample Task XMLDATA with lead lookup
| <Tasks> <row no="1"> <FL val="SMOWNERID">2000000016714</FL> <FL val="Task Owner">Scott</FL> <FL val="Subject">Demo Call</FL> <FL val="Due Date">11/23/2009</FL> <FL val="SEID">2000000018003</FL> <FL val="SEMODULE">Leads</FL> <FL val="Status">In Progress</FL> <FL val="Priority">Highest</FL> <FL val="Send Notification Email">false</FL> <FL val="Description">Sample Desc</FL> </row> </Tasks> |
Sample Task XMLDATA with Contact and Account lookup
| <Tasks> <row no="1"> <FL val="SMOWNERID">2000000016714</FL> <FL val="Task Owner">Scott</FL> <FL val="Subject">Demo Call</FL> <FL val="Due Date">11/23/2009</FL> <FL val="CONTACTID">2000000018443</FL> <FL val="SEID">2000022218013</FL> <FL val="SEMODULE">Accounts</FL> <FL val="Status">In Progress</FL> <FL val="Priority">Highest</FL> <FL val="Send Notification Email">false</FL> <FL val="Description">Sample Desc</FL> </row> </Tasks> |
Insert notes and relate to the primary module
XML Format: http://crm.zoho.com/crm/private/xml/Notes/insertRecords?newFormat=1&apikey=API key&ticket=Ticket&xmlData=XMLDATA
XMLDATA parameter should contain the XML data as given below:
<Notes> <row no="1"> <FL val="entityId">2000000078001</FL> <FL val="Title">Zoho CRM Sample Note</FL> <FL val="Note Content">This is sample content to test Zoho CRM API</FL> </row> </Notes> |
Here the entityID is unique ID of the primary record (Lead, Account, Contact etc.)
Assign owner to the record
While inserting lead through API, make sure you are specifying the email address of the lead owner. If you use the lead owner's name or userID, lead will be assigned to the default login credential used in the API ticket.
Response URL: http://crm.zoho.com/crm/private/xml/Accounts/insertRecords?apikey=API Key&ticket=Ticket&newFormat=1
You have to pass the xmlData as a POST parameter.
Response Format:
<response uri="/crm/private/xml/Accounts/insertRecords"> <result> <message>Record(s) added successfully</message> <recorddetail> <FL val="Id">2000000039001</FL> <FL val="Created Time">2010-01-30 08:56:04</FL> <FL val="Modified Time">2010-01-30 08:56:04</FL> <FL val="Created By">mahesh1</FL> <FL val="Modified By">mahesh1</FL> </recorddetail> </result> </response> |
! This page does not exists
! This page does not exists