Fetch records

Get records from Zoho Recruit

Overview

The zoho.recruit.getRecords task is used to fetch records from Zoho Recruit. This integration task is based on the Zoho Recruit API - Get Records.

Syntax

<variable> = zoho.recruit.getRecords(<module_name>, <fromIndex>, <toIndex>, <(selectColumns)>, <sortColumnString>, <sortOrderString>, <connection>);

where:

ParameterData typeDescription

<variable> 

 KEY-VALUE

The response returned by Zoho Recruit.

<module_name>

 TEXT

Module from which the records will be fetched.

Applicable modules:

  • Candidates
  • Job Openings
  • Contacts
  • Clients
  • Interviews
  • Custom Module

<fromIndex>

 NUMBER 

The starting index of the records that will be retrieved.

<toIndex>

 NUMBER 

The last index of the records that will be retrieved.

Note: Using <fromindex> and <toindex> params you can fetch upto 200 records. So, if the difference between the <fromindex> and <toindex> exceeds 200, only the first 200 records will be fetched.

<selectColumns>

 TEXT 

Field names whose values will be included in the fetched records.

Multiple column names can be specified each separated by a comma and enclosed in brackets. Eg: (Last Name,Website,Email)

If this param is supplied with ALL or an empty value, all field values will be included in the fetched records.

Note: The field names should be provided as specified in the Zoho Recruit API document.

<sortColumnString>

 TEXT

The field based on which the fetched records will be sorted.

Note: The field names should be provided as specified in the Zoho Recruit API document

<sortOrderString>

 TEXT 

Order in which the records will be sorted. 

Allowed values:

  • asc - sorts in ascending order
  • desc - sorts in descending order

<connection>

TEXT

The link name of the Zoho Recruit connection.

Note:

  • In view of stopping new authtoken generation, a Zoho OAuth connection with appropriate scopes is mandatory in order for new integration tasks (created after the deadline specified in the post) to work as expected. Existing integration tasks will continue to work with or without the connections parameter until you manually delete the authtoken from accounts.
  • Add relevant scopes mentioned in Zoho Recruit - Get Records API while creating the connection.
  • Refer to this post for the list of Zoho services that support the connections page.
  • Learn more about connections

Example 1: Fetch record from Candidates module

The following script fetches records from the "Candidates" module, based on the specified fromIndex and toIndex, in Zoho Recruit.

response =zoho.recruit.getRecords("Candidates" , 0, 20, "ALL", "Last Name", "asc", "recruit_connection");

where:

"Candidates"
is the TEXT that represents the module from which the records will be fetched.
0
is the NUMBER that represents the index of the first of the records which will be fetched.
20
is the NUMBER that represents the index of the last of the records which will be fetched.
"ALL"
is the TEXT value that represent that all fields of the will be fetched.
"Last Name"
is a TEXT value that represents the field based on which the records will be sorted.
"asc"
is a TEXT value that represents the order in which the records that will be sorted.
"recruit_connection"
is a TEXT value that represents connection link name.

The success response returned is of the following format:

{  
   "Is Locked":"false",
   "Candidate ID":"ZR_23_CAND",
   "CANDIDATEID":"1687000000102009",
   "Is Unqualified":"false",
   "Updated On":"2015-08-05 18:41:34",
   "Created By":"dinesh.d",
   "Is Attachment Present":"true",
   "Source":"Resume",
   "MODIFIEDBY":"1687000000077003",
   "Created Time":"2015-08-05 18:41:34",
   "Modified By":"dinesh.d",
   "SMOWNERID":"1687000000077003",
   "Candidate Status":"New",
   "Last Activity Time":"2015-08-05 18:41:34",
   "SMCREATORID":"1687000000077003",
   "Email Opt Out":"false",
   "Is Hot Candidate":"false",
   "Last Name":"No name",
   "Experience in Years":"0",
   "Candidate Owner":"dinesh.d"
},
{  
   "Is Locked":"false",
   "Candidate ID":"ZR_24_CAND",
   "CANDIDATEID":"1687000000102031",
   "Is Unqualified":"false",
   "Updated On":"2015-08-05 18:47:53",
   "Created By":"dinesh.d",
   "Is Attachment Present":"true",
   "Source":"Resume",
   "MODIFIEDBY":"1687000000077003",
   "Created Time":"2015-08-05 18:47:53",
   "Modified By":"dinesh.d",
   "SMOWNERID":"1687000000077003",
   "Candidate Status":"New",
   "Last Activity Time":"2015-08-05 18:47:53",
   "SMCREATORID":"1687000000077003",
   "Email Opt Out":"false",
   "Is Hot Candidate":"false",
   "Last Name":"No name",
   "Experience in Years":"0",
   "Candidate Owner":"john"
}

To fetch the IDs of the records execute the following script:

for each var in <response_variable> 
  { 
    info var.get("<module>ID").toLong(); // example for <module>ID is CANDIDATEID 
  }

Example 2: Fetch records based on selectColumn param

The following script fetches records from the "Candidates" module in Zoho Recruit, based on the specified selectColumns param

response = zoho.recruit.getRecords("Candidates", 1,4, "(Last Name,Email,Mobile)", "Email", "desc", "recruit_connection");

where:

"Candidates"
is a TEXT that represents the module from which the records will be fetched.
1
is a NUMBER index of the first of the records which will be fetched.
4
is a NUMBER index of the last of the records which will be fetched. It is of LONG data type.
"(Last Name,Email,Mobile)"
are the TEXT values that represent the column names in the records which will be fetched.
"Email"
is a TEXT value that represents the field based on which the fetched records will be sorted.
"desc"
is a TEXT value that represents the order in which the records that will be sorted.
"recruit_connection"
is a TEXT value that represents connection link name.

The success response returned is of the following format:

{  
   "Email":"henry@zylker.com",
   "CANDIDATEID":"3342000000157003",
   "Last Name":"T",
   "Mobile":"08940270215"
},
{  
   "Email":"richardPatrick@zylker.com",
   "CANDIDATEID":"3342000000266010",
   "Last Name":"Patrick"
},
{  
   "Email":"richard@zylker.com",
   "CANDIDATEID":"3342000000267001",
   "Last Name":"Richard",
   "Mobile":"+91 9988776655"
},
{  
   "Email":"john@zylker.com,tony@zylker.com",
   "CANDIDATEID":"3342000000161049",
   "Last Name":"No name"
}

Related Links

Share this post : FacebookTwitter

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

Write to us: support@zohodeluge.com