getRecordById Method

getRecordById Method

Purpose

You can use this method to retrieve individual records by record ID.

Request URL

XML Format:
https://crm.zoho.com/crm/private/xml/Leads/getRecordById?authtoken=Auth Token&scope=crmapi&id=RecordID

JSON Format:
https://crm.zoho.com/crm/private/json/Leads/getRecordById?&authtoken=Auth Token&scope=crmapi&id=RecordID

Request Parameters

Parameter Data Type Description
authtoken* String Encrypted alphanumeric string to authenticate your Zoho credentials.
scope* String Specify the value as crmapi
id* or idlist* String

id: Specify unique ID of the record.

idlist: Specify unique set of IDs (separated by semicolon). You can specify up to 100 IDs using this parameter.

newFormat Integer (1 or 2) newFormat=1: To exclude fields with "null" values while fetching data from your CRM account.newFormat=2: To include fields with "null" values while fetching 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.

* - Mandatory parameter

Note:

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

Examples

To Fetch Records by ID, use the URL given below:

https://crm.zoho.com/crm/private/xml/Leads/getRecordById?authtoken=Auth Token&scope=crmapi&id=ID

To Fetch Records by ID List, use the URL given below:

https://crm.zoho.com/crm/private/xml/Leads/getRecordById?authtoken=Auth Token&scope=crmapi&idlist=ID1;ID2;...;ID100

Note:

  • You can fetch records either using id or idlist parameter. Use "id" parameter to retrieve records of a unique ID. Use "idlist" parameter to retrieve records of desired IDs.

To Fetch Leads without specifying the newFormat parameter

Note:

  • When there is no specification about the response format, the default value "1" is assigned to the newFormat parameter, i.e newFormat = 1

https://crm.zoho.com/crm/private/xml/Leads/getRecordById?authtoken=Auth Token&scope=crmapi&id=2000000022020&selectColumns=Leads(Lead Owner,First Name,Last Name,Email,Company,No of Employees,Annual Revenue,Created By,Created Time)

This will return a response like below:

<Leads>
<row no="1">
<FL val="LEADID">2000000022020</FL>
<FL val="SMOWNERID">2000000018005</FL>
<FL val="Lead Owner">John</FL>
<FL val="Company">Zillium</FL>
<FL val="First Name">Scott</FL>
<FL val="Last Name">James</FL>
<FL val="No of Employees">10</FL>
<FL val="Annual Revenue">1000.0</FL>
<FL val="SMCREATORID">2000000016908</FL>
<FL val="Created By">John</FL>
<FL val="Created Time">2010-03-16 10:04:52</FL>
<FL val="Modified Time">2010-03-16 10:04:52</FL>
</row>
</Leads>

To Fetch Leads specifying the idlist parameter

https://crm.zoho.com/crm/private/xml/Leads/getRecordById?authtoken=Auth Token&scope=crmapi&idlist=108490000014005;108490000020024

This will return a response like below:

<Leads>
<row no="1">
<FL val="LEADID">108490000015005</FL>
<FL val="SMOWNERID">10849000015001</FL>
<FL val="Lead Owner">John</FL>
<FL val="Company">Zylker Inc.</FL>
<FL val="Last Name">James</FL>
<FL val="No of Employees">100</FL>
<FL val="SMCREATORID">10849000014001</FL>
<FL val="Created By">John</FL>
<FL val="MODIFIEDBY">10849000015001</FL>
<FL val="Modified By">John</FL>
<FL val="Created Time">2014-04-30 17:41:05</FL>
<FL val="Modified Time">2014-10-08 14:41:21</FL>
<FL val="Last Activity Time">2014-10-08 14:42:16</FL>
</row>
<row no="2">
<FL val="LEADID">108490000020024</FL>
<FL val="SMOWNERID">1081490000078001</FL>
<FL val="Lead Owner">John</FL>
<FL val="Company">Acme Inc.</FL>
<FL val="Last Name">Scott</FL>
<FL val="SMCREATORID">1081490000078001</FL>
<FL val="Created By">John</FL>
<FL val="MODIFIEDBY">1081490000078001</FL>
<FL val="Modified By">John</FL>
<FL val="Created Time">2014-10-27 15:18:11</FL>
<FL val="Modified Time">2014-11-26 12:53:13</FL>
<FL val="Last Activity Time">2014-11-26 12:53:13</FL>
</row>
</Leads>

Test Program

You can use the attached program to run and test the working of the getRecordById method in your Java Environment.
The Java Program contains the following:

  • the auth token generation format
  • the parameters and their values
  • actual usage of the method

Click here to download the program

    • Related Articles

    • getRecordbyID Method - Comparison

      Purpose To get the details of a specific record. Request URL Version 1.0: https://crm.zoho.com/crm/private/xml/Leads/getRecords?authtoken=AuthToken&scope=crmapi&id=RecordID Version 2.0: URL: https://www.zohoapis.com/crm/v2/Leads/1386586000002572002 ...
    • 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: ...
    • searchRecords Method

       Purpose You can use the searchRecords method to get the list of records that meet your search criteria.  Request URL XML Format: https://crm.zoho.com/crm/private/xml/Leads/searchRecords?authtoken=Auth Token&scope=crmapi&criteria=(((Last ...
    • deleteFile Method

      Purpose You can use this method to delete files attached to records. Request URL XML Format: https://crm.zoho.com/crm/private/xml/Leads/deleteFile?authtoken=Auth Token&scope=crmapi&id=Attachment Id JSON Format: ...