InsertRecords

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

Method: POST

Request body: The content of a record given in JSON format.

Header: Authorization=Zoho-oauthtoken {oauth_token}

Request Parameters

Version 1.0Version 2.0
authtoken=****Authorization=Zoho-oauthtoken ***** - as a Header.
scope=crmapiN/A
xmlDataN/A - Input data has to be given in request body
wfTrigger=true“trigger”:[“workflow”,”approval”,”blueprint”]
The above key has to be given within request body
duplicateCheckDuplicate check is carried out be default.
isApproval“trigger”:[“workflow”,”approval”,”blueprint”]
The above key has to be given within request body
newFormatN/A
versionN/A
 

Sample API Request:

Request in Version 1.0Request in Version 2.0
https://crm.zoho.com/crm/private/xml/Leads/insertRecords?authtoken=****&wfTrigger=true&xmlData=<Leads><row no="1"><FL val="Last Name">test1</FL><FL val="Company">com1</FL></row></Leads>URL - https://www.zohoapis.com/crm/v2/Leads
Body:
  {
    "data": [
      {
        "Last_Name":"Ben",
        "Company":"Zylker"
      }
    ],
“triggger”:[“workflow”,”approval”,”blueprint”]
}

Sample Responses:

+
Response in Version 1.0Response in Version 2.0
<?xml version="1.0" encoding="UTF-8" ?>
<response uri="/crm/private/xml/Leads/insertRecords">
<result>
<message>Record(s) added successfully</message>
<recorddetail>
<FL val="Id">1386586000002579001</FL>
<FL val="Created Time">2018-03-2719:21:54</FL>
<FL val="Modified Time">2018-03-2719:21:54</FL>
<FL val="Created By"><![CDATA[Bruce Wills]]></FL>
<FL val="Modified By"><![CDATA[Bruce Wills]]></FL>
</recorddetail>
</result>
</response>
{
  "data": [
   {
    "code": "SUCCESS",
    "details": {
     "Modified_Time": "2018-03-27T19:20:28+05:30",
     "Modified_By": {
      "name": "Bruce Wills",
      "id": "1386586000000078001"
     },
     "Created_Time": "2018-03-27T19:20:28+05:30",
     "id": "1386586000002572002",
     "Created_By": {
      "name": "Bruce Wills",
      "id": "1386586000000078001"
     },
    "display_name": "Deb",
    "type": "recycle",
    "Created_By": {
     "name": "Bruce Wills",
     "id": "1386586000000078001"
     }
    },
    "message": "record added",
    "status": "success",
   }   ]  }
 

Note:

The field, "id" in v1.0 APIs is equivalent to "id" in the first JSON object of the "data" JSON array.

Input format changes for Activities module:

Version 1.0Version 2.0
<Events><row no="1">
<FL val="Subject">Title3</FL>
<FL val="Start DateTime">2018-04-1111:00:00</FL>
<FL val="End DateTime">2018-04-1112:00:00</FL>
<FL val="CONTACTID">1386586000002379006</FL>
<FL val="SEID">1386586000001570009</FL>
<FL val="SEMODULE">Accounts</FL>
</row>
</Events>
{
  "data": [
   {
    "Event_Title":"titl1",
    "Start_DateTime":"2018-04-11T11:00:00+05:30",
    "End_DateTime":"2018-04-11T12:00:00+05:30",
    "Who_Id": "1386586000002379006",
    "$se_module": "Accounts",
    "What_Id": "1386586000001570009"
   }
  ]
}
 

Note:

  • CONTACTID is equivalent to id in Who_Id JSONObject.
  • SEMODULE is equivalent to $se_module.
  • SEID is equivalent to id in What_Id JSONObject.

Input format changes for Inventory module:

Version 1.0Version 2.0
<Invoices><row no="1">
<FL val="Subject">test inv2</FL>
<FL val="ACCOUNTID">1386586000002307022</FL>
<FL val="Tax">1.23</FL>
<FL val="Adjustment">5</FL>
<FL val="Grand Total">305</FL>
<FL val="Product Details">
<product no="1">
<FL val="Product Id">1386586000000097001</FL>
<FL val="Unit Price">10.0</FL>
<FL val="Quantity">3.0</FL>
<FL val="Total">300.0</FL>
<FL val="Discount">1.23</FL>
<FL val="Total After Discount">288.77</FL>
<FL val="List Price">100.0</FL>
<FL val="Net Total">288.77</FL>
</product>
</FL>
</row>
</Invoices>
{
  "data": [
   {
    "Adjustment": 5,
    "Product_Details":
    [
     {
      "product": {
       "id": "1386586000000097001"
      },
      "quantity": 3,
      "list_price": 100,
      "unit_price": 22,
      "line_tax": [{"percentage": 2,"name": "Sales Tax"},{"percentage": 3,"name": "Vat"}]
     }
    ],
    "Subject": "test inv4",
    "Account_Name":
    "1386586000000753001",
    "$line_tax": [{"percentage": 1,"name":
    "Sales Tax"},{"percentage": 0.5,"name": "Vat"}]
   }
  ]
}

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: support@zohocrm.com