insertRecords Method

insertRecords Method

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:

https://crm.zoho.com/crm/private/xml/Leads/insertRecords?authtoken=AuthToken&scope=crmapi&xmlData=Your XML Data 

Request Parameters

Parameter Data Type Description
authtoken* String Encrypted alphanumeric string to authenticate your Zoho credentials.
scope* String Specify scope as crmapi
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.
version Integer version = 1: (Default Value) This will fetch responses based on the earlier API implementation i.e prior to the enhancements made.
version = 2: This will fetch responses based on the latest API implementation.
version = 4:This will trigger duplicate check functionality for multiple records.

* - Mandatory parameter

Note:

  • Refer the Release Notes  page to learn more about enhancements made in the API implementation.

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
CustomModule CustomModule Name

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 Auth Token.
  • 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:
https://crm.zoho.com/crm/private/xml/Leads/insertRecords?newFormat=1&authtoken=Auth Token&scope=crmapi&xmlData=Your XML Data

Sample Request:

https://crm.zoho.com/crm/private/xml/Leads/insertRecords?
newFormat=1
&authtoken=Auth Token
&scope=crmapi
&xmlData=

<Leads>
<row no="1">
<FL val="Lead Source">Web Download</FL>
<FL val="Company">Your Company</FL>
<FL val="First Name">Hannah</FL>
<FL val="Last Name">Smith</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@zohotest.com</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="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@zohotest.com</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@zohotest.com</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:

https://crm.zoho.com/crm/private/xml/Notes/insertRecords?newFormat=1&authtoken=Auth Token
&scope=crmapi
&xmlData=

<Notes>
<row no="1">
<FL val="entityId">2000000078001</FL>
<FL val="Note 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 a record through API, make sure you are specifying the email address or userID of the record owner. If you use the record owner's name, the record will be assigned to the default login credential used in the Auth Token. If you want to use the userID to specify the record owner, then add <FL val="SMOWNERID">userID</FL> tag to your xmlData.

Note:

  • In the following examples, replace the values for 'authotoken' and 'scope' with those generated by you.

Cases

https://crm.zoho.com/crm/private/xml/Cases/insertRecords?authtoken=Auth Token&scope=crmapi
&newFormat=1
&xmlData=

<Cases>
<row no="1">
<FL val="Case Origin">Phone</FL>
<FL val="Status">Escalated</FL>
<FL val="Subject">New Case</FL>
<FL val="Account Name">Account for Cases</FL>
<FL val="WHOID">508020014316189251</FL>
</row>
</Cases>

Note:

  • The WHOID field refers to the Related To field in the Cases module. Give the ID of the record that you want to associate to the cases as a Related To field value in the WHOID field.

Tasks

https://crm.zoho.com/crm/private/xml/Tasks/insertRecords?authtoken=Auth Token&scope=crmapi
&newFormat=1
&xmlData=

<Tasks>
<row no="1">
<FL val="Subject">Call</FL>
<FL val="Due Date">2009-04-20</FL>
<FL val="Status">Deferred</FL>
<FL val="CONTACTID">2000000017017</FL>
</row>
</Tasks>

Events

https://crm.zoho.com/crm/private/xml/Events/insertRecords?authtoken=Auth Token&scope=crmapi
&newFormat=1
&xmlData=

<Events>
<row no="1">
<FL val="Subject">Conference</FL>
<FL val="Start DateTime">2009-08-04 01:00:00</FL>
<FL val="End DateTime">2009-08-05 01:00:00</FL>
<FL val="Venue">United States</FL>
<FL val="Send Notification Email">True</FL>
</row>
</Events>

Events with Contacts and Case Mapping

https://crm.zoho.com/crm/private/xml/Events/insertRecords?authtoken=Auth Token&scope=crmapi
&newFormat=1
&xmlData=

<Events>
<row no="1">
<FL val="Subject">Conference</FL>
<FL val="Start DateTime">2009-09-24 01:00:00</FL>
<FL val="End DateTime">2009-09-25 01:00:00</FL>
<FL val="Venue">Chennai</FL>
<FL val="CONTACTID">2000000055003</FL>
<FL val="SEID">2000000055007</FL>
<FL val="SEMODULE">Cases</FL>
</row>
</Events>

Accounts

https://crm.zoho.com/crm/private/xml/Accounts/insertRecords?authtoken=Auth Token&scope=crmapi
&newFormat=1
&xmlData=

<Accounts>
<row no="1">
<FL val="Account Name">Zillum</FL>
<FL val="Website">www.zillum.com</FL>
<FL val="Employees">200</FL>
<FL val="Ownership">Private</FL>
<FL val="Industry">Real estate</FL>
<FL val="Fax">99999999</FL>
<FL val="Annual Revenue">20000000</FL>
</row>
</Accounts>

Contacts

https://crm.zoho.com/crm/private/xml/Contacts/insertRecords?authtoken=Auth Token&scope=crmapi
&newFormat=1
&xmlData=

<Contacts>
<row no="1">
<FL val="First Name">Scott</FL>
<FL val="Last Name">James</FL>
<FL val="Email">test@test.com</FL>
<FL val="Department">CG</FL>
<FL val="Phone">999999999</FL>
<FL val="Fax">99999999</FL>
<FL val="Mobile">99989989</FL>
<FL val="Assistant">John</FL>
</row>
</Contacts>

SalesOrders

Note:

  • A value for "Product Id" is mandatory.

https://crm.zoho.com/crm/private/xml/SalesOrders/insertRecords?authtoken=Auth Token&scope=crmapi
&newFormat=1
&xmlData=

<SalesOrders>
<row no="1">
<FL val="Subject">Zillium - SO</FL>
<FL val="Due Date">2009-03-10</FL>
<FL val="Sub Total">48000.0</FL>
<FL val="Tax">0.0</FL>
<FL val="Adjustment">0.0</FL>
<FL val="Grand Total">48000.0</FL>
<FL val="Billing Street">test</FL>
<FL val="Shipping Street">test</FL>
<FL val="Billing City">test</FL>
<FL val="Shipping City">test</FL>
<FL val="Billing State">test</FL>
<FL val="Shipping State">test</FL>
<FL val="Billing Code">223</FL>
<FL val="Shipping Code">223</FL>
<FL val="Billing Country">test</FL>
<FL val="Shipping Country">test</FL>
<FL val="Product Details">
<product no="1">
<FL val="Product Id">2000000017001</FL>
<FL val="Unit Price">10.0</FL>
<FL val="Quantity">1.0</FL>
<FL val="Total">123.0</FL>
<FL val="Discount">1.23</FL>
<FL val="Total After Discount">121.77</FL>
<FL val="List Price">123.0</FL>
<FL val="Net Total">121.77</FL>
</product>
</FL>
<FL val="Terms and Conditions">Test by Zoho</FL>
<FL val="Description">Test By Zoho</FL>
</row>
</SalesOrders>

Quotes

Note:

  • A value for "Product Id" is mandatory.

https://crm.zoho.com/crm/private/xml/Quotes/insertRecords?authtoken=Auth Token&scope=crmapi
&newFormat=1
&xmlData=

<Quotes>
<row no="1">
<FL val="Subject">Zillium - Quote</FL>
<FL val="Due Date">2009-03-10</FL>
<FL val="Sub Total">48000.0</FL>
<FL val="Tax">0.0</FL>
<FL val="Adjustment">0.0</FL>
<FL val="Grand Total">48000.0</FL>
<FL val="Billing Street">test</FL>
<FL val="Shipping Street">test</FL>
<FL val="Billing City">test</FL>
<FL val="Shipping City">test</FL>
<FL val="Billing State">test</FL>
<FL val="Shipping State">test</FL>
<FL val="Billing Code">223</FL>
<FL val="Shipping Code">223</FL>
<FL val="Billing Country">test</FL>
<FL val="Shipping Country">test</FL>
<FL val="Product Details">
<product no="1">
<FL val="Product Id">2000000017001</FL>
<FL val="Unit Price">10.0</FL>
<FL val="Quantity">1.0</FL>
<FL val="Total">123.0</FL>
<FL val="Discount">1.23</FL>
<FL val="Total After Discount">121.77</FL>
<FL val="List Price">123.0</FL>
<FL val="Net Total">121.77</FL>
</product>
</FL>
<FL val="Terms and Conditions">Test by Zoho</FL>
<FL val="Description">Test By Zoho</FL>
</row>
</Quotes>

Example of a Quote with Multiple Products:

https://crm.zoho.com/crm/private/xml/Quotes/insertRecords?authtoken=Auth Token&scope=crmapi
&xmlData=

<Quotes>
<row no="1">
<FL val="Subject">TEST</FL>
<FL val="Quote Stage">Draft</FL>
<FL val="Carrier">FedEX</FL>
<FL val="ACCOUNTID">269840000000150037</FL>
<FL val="Account Name">phone account11 9pm</FL>
<FL val="SMOWNERID">269840000000034003</FL>
<FL val="Quote Owner">TEST</FL>
<FL val="SMCREATORID">269840000000034003</FL>
<FL val="Created By">TEST</FL>
<FL val="MODIFIEDBY">269840000000034003</FL>
<FL val="Modified By">TEST</FL>
<FL val="Created Time">2010-10-19 16:16:41</FL>
<FL val="Modified Time">2010-10-19 16:16:56</FL>
<FL val="Sub Total">23.0</FL>
<FL val="Tax">0.0</FL>
<FL val="Adjustment">0.0</FL>
<FL val="Grand Total">23.0</FL>
<FL val="Product Details">
<product no="1">
<FL val="Product Id">269840000000136287</FL>
<FL val="Product Name">prd1</FL>
<FL val="Unit Price">0.0</FL>
<FL val="Quantity">1.0</FL>
<FL val="Quantity in Stock">0.0</FL>
<FL val="Total">23.0</FL>
<FL val="Discount">0.0</FL>
<FL val="Total After Discount">23.0</FL>
<FL val="List Price">23.0</FL>
<FL val="Net Total">23.0</FL>
<FL val="Tax">0.0</FL>
</product>
<product no="2">
<FL val="Product Id">269840000000128149</FL>
<FL val="Product Name">prd2</FL>
<FL val="Unit Price">0.0</FL>
<FL val="Quantity">1.0</FL>
<FL val="Quantity in Stock">0.0</FL>
<FL val="Total">23.0</FL>
<FL val="Discount">0.0</FL>
<FL val="Total After Discount">23.0</FL>
<FL val="List Price">23.0</FL>
<FL val="Net Total">23.0</FL>
<FL val="Tax">0.0</FL>
</product>
</FL>
<FL val="Terms and Conditions">Test by Zoho</FL>
<FL val="Discount">0.0</FL>
<FL val="Date Field">07/21/2010</FL>
</row>
</Quotes>

Insert Calls with Contacts and Accounts Lookup

<Calls>
<row no="1">
<FL val="SMOWNERID">2000000018005</FL>
<FL val="Subject">Product Support</FL>
<FL val="Call Type">Inbound</FL>
<FL val="Call Purpose">Prospecting</FL>
<FL val="CONTACTID">2000000018001</FL>
<FL val="SEID">2000000018003</FL>
<FL val="SEMODULE">Accounts</FL>
<FL val="Call Start Time">2011-06-10 22:10:00</FL>
<FL val="Call Duration">60:00</FL>
<FL val="Description">Required Product Demo</FL>
<FL val="Billable">true</FL>
<FL val="Call Result">Successful</FL>
</row>
</Calls>

Insert Calls with Leads Lookup

<Calls>
<row no="1">
<FL val="SMOWNERID">2000000018005</FL>
<FL val="Subject">Demo</FL>
<FL val="Call Type">Inbound</FL>
<FL val="Call Purpose">Prospecting</FL>
<FL val="SEID">2000000017201</FL>
<FL val="SEMODULE">Leads</FL>
<FL val="Call Start Time">2011-06-10 22:10:00</FL>
<FL val="Call Duration">60:00</FL>
<FL val="Description">Demo Call</FL>
<FL val="Billable">true</FL>
<FL val="Call Result">Successful</FL>
</row>
</Calls>

Usage of 'CDATA'

Purpose: To consider Special Characters as plain text and NOT XML Data

URL Format:
https://crm.zoho.com/crm/private/xml/Contacts/insertRecords?newFormat=1&authtoken=Auth Token&scope=crmapi&xmlData= Your XML Data

Sample XML Data:

as POST:

<Contacts>
<row no="1">
<FL val="First Name">Amy</FL>
<FL val="Last Name">Dawson</FL>
<FL val="Email">testing@testing.com</FL>
<FL val="Title">Manager</FL>
<FL val="Phone">1234567890</FL>
<FL val="Mobile">292827622</FL>
<FL val="Account Name"> <![CDATA["A & A"]]> </FL>
</row>
</Contacts>

as GET:

<Contacts>
<row no="1">
<FL val="First Name">Amy</FL>
<FL val="Last Name">Dawson</FL>
<FL val="Email">testing@testing.com</FL>
<FL val="Title">Manager</FL>
<FL val="Phone">1234567890</FL>
<FL val="Mobile">292827622</FL>
<FL val="Account Name"> <![CDATA["A & A"]]> </FL>
</row>
</Contacts>

Note:

  • "&" will be considered as "&"

Insert Multiple records

URL Format: https://crm.zoho.com/crm/private/xml/Leads/insertRecords?newFormat=1&authtoken=Auth Token&scope=crmapi&xmlData= Your XML Data

XMLDATA sample:

<Leads>
    <row no="1"><FL val="Last Name">testing</FL><FL val="Company">ZOHO</FL></row>
    <row no="2"><FL val="Last Name">testing</FL><FL val="Company">ZOHO</FL></row>
    <row no="3"><FL val="Last Name">testing</FL><FL val="Company">ZOHO</FL></row>
    <row no="4"><FL val="Last Name">testing</FL><FL val="Company">ZOHO</FL></row>
    <row no="5"><FL val="Last Name">testing</FL><FL val="Company">ZOHO</FL></row>
    <row no="6"><FL val="Last Name">testing</FL><FL val="Company">ZOHO</FL></row>
    <row no="7"><FL val="Last Name">testing</FL><FL val="Company">ZOHO</FL></row>
    <row no="8"><FL val="Last Name">testing</FL><FL val="Company">ZOHO</FL></row>
    <row no="9"><FL val="Last Name">testing</FL><FL val="Company">ZOHO</FL></row>
    <row no="10"><FL val="Last Name">testing</FL><FL val="Company">ZOHO</FL></row>
 :
 :
 :
 
    <row no="100"><FL val="Last Name">testing</FL><FL val="Company">ZOHO</FL></row>
</Leads>

Notes:

When inserting multiple records with the insertRecords method:

  • Duplicate Check will not function. However, we support duplicate check for multiple records  in version 4
  • Workflow Rules will not be triggered for records that meet the criteria
  • Multiple Records cannot be inserted for the Quotes, SalesOrders, Invoices and PurchaseOrders modules.
  • Only the first 100 records will be considered when inserting multiple records.

Duplicate Check for Multiple Records

Purpose

You can use insertRecords to trigger duplicate check functionality for multiple records. Please note that version=4 is a mandatory parameter.

We have introduced three new codes that will represent the API result status for each record. The codes are as given below:

2000 = Record Added Successfully
2001 = Record Updated Successfully
2002 = Record Already Exists

URL Format :

https://crm.zoho.com/crm/private/xml/Leads/insertRecords?authtoken=Auth  Token&scope=crmapi&duplicateCheck=( 1 OR 2 )&version=4&xmlData= Your XML Data

Sample XML Data

<Leads>
    <row no="1">
<FL val="Company">Company1</FL>
<FL val="Last Name">Last Name1</FL>
<FL val="Email">automation@crm.com 1</FL>
    </row>
    <row no="2">
<FL val="Company">Company2</FL>
<FL val="Last Name">Last Name2</FL>
<FL val="Email">automation@crm.com 2</FL>
    </row>
</Leads> 

Sample Response

If duplicateCheck=1 , version=4, some records exist with the email address and some records don't exist, the functionality and response will be as given below:

<response uri=/crm/private/xml/Leads/insertRecords>
                <result>
                    <row no=1>
                        <success>
                            <code>2000</code>
                            <details>
                                <FL val=Id>2000000120006</FL>
                                <FL val=Created Time>2013-02-11 17:55:04</FL>
                                <FL val=Modified Time>2013-02-11 17:55:04</FL>
                                <FL val=Created By>
                                <![CDATA[ aghil123 ]]>
                                </FL>
                                <FL val=Modified By>
                                <![CDATA[ aghil123 ]]>
                                </FL>
                            </details>
                        </success>
                    </row>
                    <row no=2>
                        <success>
                            <code>2002</code>
                            <details>
                                <FL val=Id>2000000120007</FL>
                                <FL val=Created Time>2013-02-11 17:55:04</FL>
                                <FL val=Modified Time>2013-02-11 17:55:04</FL>
                                <FL val=Created By>
                                <![CDATA[ aghil123 ]]>
                                </FL>
                                <FL val=Modified By>
                                <![CDATA[ aghil123 ]]>
                                </FL>
                            </details>
                        </success>
                    </row>
                </result>
            </response>

If duplicateCheck=1 , version=4 , no records exist with the email address, the functionality and response will be as given below:

<response uri=/crm/private/xml/Leads/insertRecords>
                <result>
                    <row no=1>
                        <success>
                            <code>2000</code>
                            <details>
                                <FL val=Id>2000000120006</FL>
                                <FL val=Created Time>2013-02-11 17:55:04</FL>
                                <FL val=Modified Time>2013-02-11 17:55:04</FL>
                                <FL val=Created By>
                                <![CDATA[ aghil123 ]]>
                                </FL>
                                <FL val=Modified By>
                                <![CDATA[ aghil123 ]]>
                                </FL>
                            </details>
                        </success>
                    </row>
                    <row no=2>
                        <success>
                            <code>2000</code>
                            <details>
                                <FL val=Id>2000000120007</FL>
                                <FL val=Created Time>2013-02-11 17:55:04</FL>
                                <FL val=Modified Time>2013-02-11 17:55:04</FL>
                                <FL val=Created By>
                                <![CDATA[ aghil123 ]]>
                                </FL>
                                <FL val=Modified By>
                                <![CDATA[ aghil123 ]]>
                                </FL>
                            </details>
                        </success>
                    </row>
                </result>
            </response>

If duplicateCheck=1 , version=4 , records exist with the email address, the functionality and response will be as given below:

<response uri="/crm/private/xml/Leads/insertRecords">
                <result>
                    <row no="1">
                        <success>
                            <code>2002</code>
                            <details>
                                <FL val="Id">2000000120006</FL>
                                <FL val="Created Time">2013-02-11 17:55:04</FL>
                                <FL val="Modified Time">2013-02-11 17:55:04</FL>
                                <FL val="Created By">
                                <![CDATA[ aghil123 ]]>
                                </FL>
                                <FL val="Modified By">
                                <![CDATA[ aghil123 ]]>
                                </FL>
                            </details>
                        </success>
                    </row>
                    <row no="2">
                        <success>
                            <code>2002</code>
                            <details>
                                <FL val="Id">2000000120007</FL>
                                <FL val="Created Time">2013-02-11 17:55:04</FL>
                                <FL val="Modified Time">2013-02-11 17:55:04</FL>
                                <FL val="Created By">
                                <![CDATA[ aghil123 ]]>
                                </FL>
                                <FL val="Modified By">
                                <![CDATA[ aghil123 ]]>
                                </FL>
                            </details>
                        </success>
                    </row>
                </result>
            </response>

If duplicateCheck=2 , version=4 , no records exist with the email address, the functionality and response will be as given below:

<response uri="/crm/private/xml/Leads/insertRecords">
                <result>
                    <row no="1">
                        <success>
                            <code>2000</code>
                            <details>
                                <FL val="Id">2000000120006</FL>
                                <FL val="Created Time">2013-02-11 17:55:04</FL>
                                <FL val="Modified Time">2013-02-11 17:55:04</FL>
                                <FL val="Created By">
                                <![CDATA[ aghil123 ]]>
                                </FL>
                                <FL val="Modified By">
                                <![CDATA[ aghil123 ]]>
                                </FL>
                            </details>
                        </success>
                    </row>
                    <row no="2">
                        <success>
                            <code>2000</code>
                            <details>
                                <FL val="Id">2000000120007</FL>
                                <FL val="Created Time">2013-02-11 17:55:04</FL>
                                <FL val="Modified Time">2013-02-11 17:55:04</FL>
                                <FL val="Created By">
                                <![CDATA[ aghil123 ]]>
                                </FL>
                                <FL val="Modified By">
                                <![CDATA[ aghil123 ]]>
                                </FL>
                            </details>
                        </success>
                    </row>
                </result>
            </response>

If duplicateCheck=2 , version=4 , records exist with the email address, the functionality and response will be as given below:

<response uri="/crm/private/xml/Leads/insertRecords">
                <result>
                    <row no="1">
                        <success>
                            <code>2001</code>
                            <details>
                                <FL val="Id">2000000120006</FL>
                                <FL val="Created Time">2013-02-11 17:55:04</FL>
                                <FL val="Modified Time">2013-02-11 17:55:04</FL>
                                <FL val="Created By">
                                <![CDATA[ aghil123 ]]>
                                </FL>
                                <FL val="Modified By">
                                <![CDATA[ aghil123 ]]>
                                </FL>
                            </details>
                        </success>
                    </row>
                    <row no="2">
                        <success>
                            <code>2001</code>
                            <details>
                                <FL val="Id">2000000120007</FL>
                                <FL val="Created Time">2013-02-11 17:55:04</FL>
                                <FL val="Modified Time">2013-02-11 17:55:04</FL>
                                <FL val="Created By">
                                <![CDATA[ aghil123 ]]>
                                </FL>
                                <FL val="Modified By">
                                <![CDATA[ aghil123 ]]>
                                </FL>
                            </details>
                        </success>
                    </row>
                </result>
            </response>

If duplicateCheck=2 ,version=4 , some records exist with the email address and some records don't, the functionality and response will be as given below:

<response uri="/crm/private/xml/Leads/insertRecords">
                <result>
                    <row no="1">
                        <success>
                            <code>2001</code>
                            <details>
                                <FL val="Id">2000000120006</FL>
                                <FL val="Created Time">2013-02-11 17:55:04</FL>
                                <FL val="Modified Time">2013-02-11 17:55:04</FL>
                                <FL val="Created By">
                                <![CDATA[ aghil123 ]]>
                                </FL>
                                <FL val="Modified By">
                                <![CDATA[ aghil123 ]]>
                                </FL>
                            </details>
                        </success>
                    </row>
                    <row no="2">
                        <success>
                            <code>2000</code>
                            <details>
                                <FL val="Id">2000000120007</FL>
                                <FL val="Created Time">2013-02-11 17:55:04</FL>
                                <FL val="Modified Time">2013-02-11 17:55:04</FL>
                                <FL val="Created By">
                                <![CDATA[ aghil123 ]]>
                                </FL>
                                <FL val="Modified By">
                                <![CDATA[ aghil123 ]]>
                                </FL>
                            </details>
                        </success>
                    </row>
                </result>
            </response>

If version=4, some records contain error and some don't, the functionality and response will be as given below:

<response uri="/crm/private/xml/Leads/insertRecords">
                <result>
                    <row no="1">
                        <success>
                            <code>2001</code>
                            <details>
                                <FL val="Id">2000000120006</FL>
                                <FL val="Created Time">2013-02-11 17:55:04</FL>
                                <FL val="Modified Time">2013-02-11 17:55:04</FL>
                                <FL val="Created By">
                                <![CDATA[ aghil123 ]]>
                                </FL>
                                <FL val="Modified By">
                                <![CDATA[ aghil123 ]]>
                                </FL>
                            </details>
                        </success>
                    </row>
                    <row no="2">
                <error>
                     <code>4832</code>
                    <details>You have given a wrong value for the field : Annual Revenue</details>
                        </error>
                    </row>
                </result>
            </response>

Insert Data in Custom Modules

Sample Request

https://crm.zoho.com/crm/private/xml/CustomModule1/insertRecords?authtoken=Auth Token&scope=crmapi
&xmlData=

<CustomModule>
<row no="1">
<FL val="CustomModule1 Name">Registration-CS1000120160101</FL>
</row>
</CustomModule>

Note:

  • Email Address is the duplicate check field for Leads module. For other modules, the duplicate check field varies. To learn more, please read - https://www.zoho.com/crm/help/api/insertrecords.html#Duplicate_Check_Field 
  • Developers can now easily identify the record id, since the record detail in the response, is given the same way the user requests in the xml data.
  • If you do not pass the version, the default functionality will be executed.
  • You have to pass version=4 in the parameter URL for duplicate check in multiple records.
    • Related Articles

    • insertRecords Method - Comparison

      Purpose To create/insert specific or multiple records. Request URL Version 1.0: https://crm.zoho.com/crm/private/xml/Leads/insertRecords?authtoken=AuthToken&scope=crmapi&xmlData=Your XML Data Version 2.0: URL: https://www.zohoapis.com/crm/v2/Leads ...
    • updateRecords Method

      Table of Contents Purpose  Request URL  Request Parameters  Additional Notes  Update owner of the record  Examples  Tasks with contact mapping  Events  Contacts  Quotes  SalesOrders  Products  Test Program  Usage of 'CDATA'  Multiple Record Updates  ...
    • updateRecords Method - Comparison

      Purpose To update specific or multiple records. Request URL Version 1.0: https://crm.zoho.com/crm/private/xml/Leads/updateRecords?authtoken=AuthToken&scope=crmapi&id=Record ID&xmlData=XML Data Version 2.0: URL: ...
    • deleteRecords Method

      Table of Contents Purpose Request URL Request Parameters Example Purpose You can use this method to delete the selected record (you must specify unique ID of the record) and move to the recycle bin. Note: This method is availablefor all modules. ...
    • downloadPhoto Method

       Purpose You can use this method to download the photos of Leads or Contacts.  Request URL XML Format: For Leads: https://crm.zoho.com/crm/private/xml/Leads/downloadPhoto?authtoken=Auth Token&scope=crmapi&id=RecordID For Contacts: ...