You can use the updateRecords method to update or modify the records in Zoho CRM.
Important: Use the POST method to pass these parameters instead of GET method.
XML Format
To update single record into a module in a single API call :
https://crm.zoho.com/crm/private/xml/Leads/updateRecords?authtoken=Auth Token&scope=crmapi&id=Record ID&xmlData=XML Data
To update multiple records into a module in a single API call :
https://crm.zoho.com/crm/private/xml/Leads/updateRecords?authtoken=Auth Token&scope=crmapi&version=4&xmlData=XML Data
Click Multiple Record Updates to view the sample xmlData and response for multiple records duplicate check.
Parameter | Data Type | Description |
authtoken* | String | Encrypted alphanumeric string to authenticate your Zoho credentials. |
scope* | String | Specify the value as crmapi |
id* | String | Specify unique ID of the record |
xmlData* | XML | Specify fields and corresponding values |
wfTrigger | Boolean | Set value as true to trigger the workflow rule while updating record into CRM account. By default, this parameter is false. |
newFormat | Integer (1 or 2) | newFormat=1: To exclude fields with "null" values while updating data from your CRM account. newFormat=2: To include fields with "null" values while updating 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: To update multiple records in a single API method call. |
* - Mandatory parameter
Note:
While updating 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.
To update records in Zoho CRM, follow the below steps:
XML data format:
https://crm.zoho.com/crm/private/xml/Leads/updateRecords?newFormat=1&authtoken=Auth Token&scope=crmapi&xmlData=XMLDATA
<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>
https://crm.zoho.com/crm/private/xml/Tasks/updateRecords?authtoken=AuthToken&scope=crmapi
&newFormat=1
&id=2000000017022
&xmlData=
<Tasks>
<row no="1">
<FL val="Subject">Meeting Hall</FL>
<FL val="Due Date">2009-04-22</FL>
<FL val="Status">Completed</FL>
<FL val="CONTACTID">2000000017027</FL>
</row>
</Tasks>
https://crm.zoho.com/crm/private/xml/Events/updateRecords?authtoken=AuthToken&scope=crmapi
&newFormat=1
&id=2000000017023
&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">Plaza</FL>
<FL val="Send Notification Email">false</FL>
</row>
</Events>
https://crm.zoho.com/crm/private/xml/Contacts/updateRecords?authtoken=AuthToken&scope=crmapi
&newFormat=1
&id=2000000017024
&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">989898988</FL>
<FL val="Fax">99999999</FL>
<FL val="Mobile">99989989</FL>
<FL val="Assistant">John</FL>
</row>
</Contacts>
Note:
https://crm.zoho.com/crm/private/xml/Quotes/updateRecords?authtoken=Auth Token&scope=crmapi
&newFormat=1
&id=2000000017025
&xmlData=<Quotes>
<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>
</Quotes>
Note:
https://crm.zoho.com/crm/private/xml/SalesOrders/updateRecords?authtoken=Auth Token&scope=crmapi
&newFormat=1
&id=2000000017026
&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>
https://crm.zoho.com/crm/private/xml/Products/updateRecords?authtoken=491e5e3374b0132324lqs2f1scb18cd0&
newFormat=1&scope=crmapi&id=508020000000366001&xmlData=
<Products>
<row no="1">
<FL val="Product Owner">manishp@zillum.com</FL>
<FL val="Product Name">Product Test</FL>
<FL val="Product Code">098732</FL>
<FL val="VENDORID">508020000000038476</FL>
<FL val="Product Active">true</FL>
<FL val="Manufacturer">AltvetPet Inc.</FL>
<FL val="Product Category">CRM App</FL>
<FL val="Sales Start Date">11/09/2012</FL>
<FL val="Sales End Date">11/11/2012</FL>
<FL val="Support Start Date">11/16/2012</FL>
<FL val="Support Expiry Date">11/18/2012</FL>
<FL val="Amount">100</FL>
<FL val="Probability">2</FL>
<FL val="Expected Revenue">200</FL>
<FL val="Unit Price">200</FL>
<FL val="Commission Rate">2</FL>
<FL val="Tax">Sales Tax;asdf</FL>
<FL val="Taxable">true</FL>
<FL val="Usage Unit">Dozen</FL>
<FL val="Qty Ordered">500000</FL>
<FL val="Qty in Stock">200000</FL>
<FL val="Reorder Level">10000</FL>
<FL val="Qty in Demand">10</FL>
<FL val="Handler">508020000000210005</FL>
<FL val="Description">Description Added for the product</FL>
</row>
</Products>
Note:
You can use the attached program to run and test the working of the updateRecords method in your Java Environment.
The Java Program contains the following:
Click here to download the program.
Purpose: To consider Special Characters as plain text and NOT XML Data
URL Format:
https://crm.zoho.com/crm/private/xml/Contacts/updateRecords?newFormat=1&authtoken=Auth Token&scope=crmapi&id=50000000216189251
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:
You can use updateRecords to update multiple records in a single updateRecords API method. Please note that version=4 is a mandatory parameter.
We have introduced a new code, that will represent the API result status for each record. The code is as given below:
2001 = Record Updated Successfully
https://crm.zoho.com/crm/private/xml/Leads/updateRecords?authtoken=Auth Token&scope=crmapi&version=4&xmlData=
<Leads>
<row no="1">
<FL val="Id">2000000178701</FL>
<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="Id">2000000178702</FL>
<FL val="Company">Company2</FL>
<FL val="Last Name">Last Name2</FL>
<FL val="Email">automation@crm.com 2</FL>
</row>
</Leads>
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">2000000178701</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">2000000178702</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 errors 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">2000000178701</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>
Note: