You can use the getRecords method to fetch all users data specified in the API request.
XML Format:
https://crm.zoho.com/crm/private/xml/Leads/getRecords?authtoken=Auth Token&scope=crmapi
JSON Format:
https://crm.zoho.com/crm/private/json/Leads/getRecords?authtoken=Auth Token&scope=crmapi
| Parameter | Data Type | Description |
| authtoken* | String | Encrypted alphanumeric string to authenticate your Zoho credentials. |
| scope* | String | Specify the value as crmapi |
| selectColumns | String | Module(optional columns) i.e, leads(Last Name,Website,Email) OR All |
| fromIndex | Integer | Default value - 1 |
| toIndex | Integer | Default value - 20 Maximum value - 200 |
| sortColumnString | String | If you use the sortColumnString parameter, by default data is sorted in ascending order. |
| sortOrderString | String | Default value - asc if you want to sort in descending order, then you have to pass sortOrderString=desc. |
| lastModifiedTime | DateTime | Default value: null If you specify the time, modified data will be fetched after the configured time. |
| 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. |
* - Mandatory parameter
Note:
URL Format:
https://crm.zoho.com/crm/private/json/Accounts/getRecords?newFormat=1&authtoken=sbdjEDBDJ445791323
&scope=crmapi&fromIndex=20&toIndex=200&sortColumnString=Account Name&sortOrderString=desc
URL Format:
https://crm.zoho.com/crm/private/xml/Accounts/getRecords?newFormat=1&authtoken=sbdjEDBDJ1323
&scope=crmapi&lastModifiedTime=2008-05-27 00:00:00
https://crm.zoho.com/crm/private/xml/Leads/getRecords?authtoken=Auth Token&scope=crmapi
&selectColumns=Leads(First Name,Last Name,Email,Company,Campaign Source)&version=1
It will return a response like below:
<Leads>
<row no="1">
<FL val="LEADID">2000000022020</FL>
<FL val="Company">Zillium</FL>
<FL val="First Name">Scott</FL>
<FL val="Last Name">James</FL>
<FL val="Email">scott@zillum.com</FL>
<FL val="CAMPAIGNID">2000000072001</FL>
<FL val="Campaign Source">Webinar</FL>
</row>
</Leads>
It will return a response like below:
<Leads>
<row no="1">
<FL val="LEADID">2000000022020</FL>
<FL val="Company">Zillium</FL>
<FL val="First Name">Scott</FL>
<FL val="Last Name">James</FL>
<FL val="Email">scott@zillum.com</FL>
</row>
</Leads>
Note:
https://crm.zoho.com/crm/private/xml/Leads/getRecords?authtoken=Auth Token&scope=crmapi&selectColumns=Leads(Lead Owner,First Name,Last Name,Email,Company,No of Employees,Annual Revenue,Created By,Created Time)
It 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>
https://crm.zoho.com/crm/private/xml/Leads/getRecords?authtoken=Auth Token&scope=crmapi
&newFormat=2&selectColumns=Leads(Lead Owner,First Name,Last Name,Company,Designation,Email,Phone,Fax,Mobile,Website,Lead Source,Lead Status,No of Employees,Annual Revenue)
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="Designation">null</FL>
<FL val="Email">null</FL>
<FL val="Phone">null</FL>
<FL val="Fax">null</FL>
<FL val="Mobile">null</FL>
<FL val="Website">null</FL>
<FL val="Lead Source">null</FL>
<FL val="Lead Status">null</FL>
<FL val="No of Employees">0</FL>
<FL val="Annual Revenue">0.0</FL>
</row>
https://crm.zoho.com/crm/private/xml/Leads/getRecords?authtoken=Auth Token&scope=crmapi
&newFormat=1
&selectColumns=Leads(Lead Owner,First Name,Last Name,Email,Company)
&fromIndex=1&toIndex=25
Note:
https://crm.zoho.com/crm/private/xml/Leads/getRecords?authtoken=Auth Token&scope=crmapi
&newFormat=1&selectColumns=Leads(Lead Owner,First Name,Last Name,Email,Company)
&lastModifiedTime=2010-04-21 11:09:23
Note:
https://crm.zoho.com/crm/private/xml/Leads/getRecords?authtoken=Auth Token&scope=crmapi
&newFormat=1&selectColumns=All
Note:
https://crm.zoho.com/crm/private/xml/Leads/getRecords?authtoken=Auth Token&scope=crmapi
&newFormat=2&selectColumns=All
Note:
https://crm.zoho.com/crm/private/xml/Leads/getRecords?authtoken=Auth Token&scope=crmapi&newFormat=1
&selectColumns=Leads(Lead Owner,First Name,Last Name,Email,Company)
&lastModifiedTime=2010-04-21 11:09:23
&fromIndex=1
&toIndex=25
https://crm.zoho.com/crm/private/xml/Accounts/getRecords?authtoken=Auth Token&scope=crmapi&newFormat=1
&selectColumns=Accounts(Account Owner,Account Name,Phone,Industry)
&lastModifiedTime=2010-04-21 11:09:23
&fromIndex=1
&toIndex=25
You can use the attached program to run and test the working of the getRecords method in your Java Environment.
The Java Program contains the following:
Click here to download the program