getCVRecords Method
Table of Contents
- Purpose
- Request URL
- Request Parameters
- Error Codes
- Examples
- To Fetch all open leads from the Lead module
- To Fetch Leads without specifying the newFormat parameter
- To Fetch with newFormat=2
- To Call with fromIndex=1, toIndex=25
- To Call with lastModifiedTime
- To select all fields from leads with newFormat=1
- To select all fields from leads with newFormat=2
- To Call with lastModifiedTime, fromIndex and toIndex
- Test Program
Purpose
You can use the getCVRecords method to fetch data with respect to the Custom View in Zoho CRM.
Important: Irrespective of the Zoho CRM Edition, you can send only 250 API requests / day. In each request you can fetch a maximum of 200 records.
Request URL
XML Format:
https://crm.zoho.com/crm/private/xml/Leads/getCVRecords?authtoken=Auth Token&scope=crmapi&cvName=Name of Custom View
JSON Format:
https://crm.zoho.com/crm/private/json/Leads/getCVRecords?authtoken=Auth Token&scope=crmapi&cvName=Name of Custom View
Request Parameters
Parameter | Data Type | Description |
authtoken* | String | Encrypted alphanumeric string to authenticate your Zoho credentials. |
scope* | String | Specify the value as crmapi |
fromIndex | Integer | Default value - 1 |
toIndex | Integer | Default value - 20 Maximum value - 200 |
cvName* | String | Fetch the data for specified custom View. Example: cvName=All Open Leads |
lastModifiedTime | DateTime | Default:null If you specify the time, created/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) This will fetch responses based on the earlier API implementation i.e prior to the enhancements made. Current version is 4. |
* - Mandatory parameter
Error Codes
Please refer Error Codes .
Examples
To Fetch all open leads from the Lead module
https://crm.zoho.com/crm/private/xml/Leads/getCVRecords?newFormat=1&authtoken=Auth Token&scope=crmapi&cvName=All Open Leads
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/getCVRecords?authtoken=Auth Token&scope=crmapi&cvName=All Open Leads&selectColumns=Leads(Lead Owner,First Name,Last Name,Email,Company)
It will return a response like showm 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>
</row>
<row no="2">
<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>
</row>
</Leads>
The value for Email is null and so, it is not shown in the response.
To Fetch with newFormat=2
https://crm.zoho.com/crm/private/xml/Leads/getCVRecords?authtoken=Auth Token&scope=crmapi&newFormat=2
&cvName=All Open Leads
&selectColumns=Leads(Lead Owner,First Name,Last Name,Company,Designation,Email,Phone,Fax,Mobile,Website,Lead Source,Lead Status,No of Employees,Annual Revenue,Campaign Source)
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>
<FL val="CAMPAIGNID">null</FL>
<FL val="Campaign Source">null</FL>
</row>
<row no="2">
<FL val="LEADID">200000002222</FL>
<FL val="SMOWNERID">2000000018005</FL>
<FL val="Lead Owner">John</FL>
...............
...............
</row>
<row no="3">
<FL val="LEADID">2000000024444</FL>
<FL val="SMOWNERID">2000000018005</FL>
<FL val="Lead Owner">John</FL>
...............
...............
</row>
</Leads>
To Call with fromIndex=1, toIndex=25
https://crm.zoho.com/crm/private/xml/Leads/getCVRecords?authtoken=Auth Token&scope=crmapi
&newFormat=1
&cvName=All Open Leads
&selectColumns=Leads(Lead Owner,First Name,Last Name,Email,Company)
&fromIndex=1
&toIndex=25
Note:
- This will return the first 25 records.
To Call with lastModifiedTime
https://crm.zoho.com/crm/private/xml/Leads/getCVRecords?authtoken=Auth Token&scope=crmapi
&newFormat=1
&cvName=All Open Leads
&selectColumns=Leads(Lead Owner,First Name,Last Name,Email,Company)
&lastModifiedTime=2010-04-21 11:09:23
Note:
- If you specify the time, modified data will be fetched after the configured time.
To select all fields from leads with newFormat=1
https://crm.zoho.com/crm/private/xml/Leads/getCVRecords?authtoken=Auth Token&scope=crmapi&newFormat=1&selectColumns=All&cvName=All Open Leads
Note:
- This will return all fields having values.
To select all fields from leads with newFormat=2
https://crm.zoho.com/crm/private/xml/Leads/getCVRecords?authtoken=Auth Token&scope=crmapi&newFormat=2&selectColumns=All&cvName=All Open Leads
Note:
- This will return all fields, including the null value fields.
To Call with lastModifiedTime, fromIndex and toIndex
https://crm.zoho.com/crm/private/xml/Leads/getCVRecords?authtoken=Auth Token&scope=crmapi
&newFormat=1
&cvName=All Open Leads
&selectColumns=Leads(Lead Owner,First Name,Last Name,Email,Company)
&lastModifiedTime=2010-04-21 11:09:23
&fromIndex=1
&toIndex=25
Test Program
You can use the attached program to run and test the working of the getCVRecords method in your Java Environment.The Java Program contains the following:
- the token generation format
- the parameters and their values
- actual usage of the method
Click here to download the program.