getRelatedRecords Method

  1. Purpose
  2. Request URL
  3. Request Parameters
  4. Related Lists Supported
  5. Examples
    1. To view files attached to a record
    2. To fetch notes under a record
       

Purpose

You can use the getRelatedRecords method to fetch related records.

For example, you can fetch Candidates related to a Campaign or fetch tasks related to a Client.

Request URL

XML Format:
https://recruit.zoho.com/recruit/private/xml/Notes/getRelatedRecords?authtoken=Auth Token&scope=recruitapi&id=Record ID&parentModule=Module Name&version=2

JSON Format:
https://recruit.zoho.com/recruit/private/json/Notes/getRelatedRecords?authtoken=Auth Token&scope=recruitapi&id=Record ID&parentModule=Module Name&version=2

Request Parameters

ParameterData TypeDescription
authtoken*StringEncrypted alphanumeric string to authenticate your Zoho credentials. 
scope*StringSpecify the value as recruitapi
parentModule*StringModule for which you want to fetch the related records
Example: If you want to fetch Candidates related to a Campaign, then Campaigns is your parent module.
id*IntegerThe id of the record for which you want to fetch related records
newFormatIntegernewFormat=1: To exclude fields with "null" values while inserting data from your Recruit account.
newFormat=2: To include fields with "null" values while inserting data from your Recruit account.
fromIndexIntegerDefault value - 1
toIndexIntegerDefault value - 20
Maximum value - 200
version*IntegerUse version=2: This will fetch responses based on the latest API implementation.

* - Mandatory parameter

Note: The getRelatedRecords method does not support Custom Lookup fields.
 

Related Lists Supported

The getRelatedRecords method supports Notes and Attachments modules currently.

Examples

To view files attached to a record

 

URL Format:

https://recruit.zoho.com/recruit/private/xml/Attachments/getRelatedRecords?authtoken=Your Auth Token&newFormat=1&scope=recruitapi&parentModule=Candidates&id=508020000000957321

Sample Response:

<response uri="/recruit/private/xml/Attachments/getRelatedRecords">
<result>
<Attachments>
<row no="1">
<FL val="id">5080200000005483628</FL>
<FL val="File Name">
<![CDATA[ wallpaper.jpeg ]]>
</FL>
<FL val="Size">
<![CDATA[ 17.56 KB ]]>
</FL>
<FL val="Modified Time">
<![CDATA[ 2012-07-03 14:58:36 ]]>
</FL>
<FL val="SMOWNERID">508020000000065849</FL>
<FL val="Attached By">
<![CDATA[ charles stone]]>
</FL>

<FL val="Category">
<![CDATA[ Resume ]]>
</FL>

</row>
<row no="2">
<FL val="id">5080200000000906253</FL>
<FL val="File Name">
<![CDATA[ image.jpeg ]]>
</FL>
<FL val="Size">
<![CDATA[ 8.55 KB ]]>
</FL>
<FL val="Modified Time">
<![CDATA[ 2012-07-03 14:58:35 ]]>
</FL>
<FL val="SMOWNERID">508020000000065849</FL>
<FL val="Attached By">
<![CDATA[ charles stone]]>
</FL>

<FL val="Category">
<![CDATA[ Others ]]>
</FL>

</row>
<row no="3">
<FL val="id">5080200000009873561</FL>
<FL val="File Name">
<![CDATA[ sample-image.jpg ]]>
</FL>
<FL val="Size">
<![CDATA[ 11.47 KB ]]>
</FL>
<FL val="Modified Time">
<![CDATA[ 2012-07-03 14:58:35 ]]>
</FL>
<FL val="SMOWNERID">508020000000065849</FL>
<FL val="Attached By">
<![CDATA[ charles stone]]>

<FL val="Category">
<![CDATA[ Others ]]>
</FL>
 

</FL>
</row>
<row no="4">
<FL val="id">5080200000001928374</FL>
<FL val="File Name">
<![CDATA[ test-img.jpg ]]>
</FL>
<FL val="Size">
<![CDATA[ 8.16 KB ]]>
</FL>
<FL val="Modified Time">
<![CDATA[ 2012-07-03 14:58:35 ]]>
</FL>
<FL val="SMOWNERID">508020000000065849</FL>
<FL val="Attached By">
<![CDATA[ charles stone]]>
</FL>

<FL val="Category">
<![CDATA[ Others ]]>
</FL>
 

</row>
</Attachments>
</result>
</response>

To fetch notes under a record

 

URL Format:

https://recruit.zoho.com/recruit/private/xml/Notes/getRelatedRecords?authtoken=<Your Authtoken>&scope=recruitapi&id=RECORD_ID&parentModule=Module Name

Sample Response:

<response uri="/recruit/private/xml/Notes/getRelatedRecords">
<result>
<Notes>
<row no="1">
<FL val="id">5080200000005483628</FL>

<FL val="Title">
<![CDATA[ Notes ]]>
</FL>

<FL val="Note Content">
<![CDATA[ New note under the record ]]>
</FL>
<FL val="SMOWNERID">508020000000065849</FL>
<FL val="Owner Name">
<![CDATA[ James ]]>
</FL>
<FL val="SMCREATORID">508020000000065849</FL>
<FL val="Created By">
<![CDATA[ James ]]>
</FL>
<FL val="Created Time">
<![CDATA[ 2012-12-12 05:00:00 ]]>
</FL>
<FL val="MODIFIEDBY">508020000000065849</FL>
<FL val="Modified By">
<![CDATA[ James ]]>
</FL>
<FL val="Modified Time">
<![CDATA[ 2012-12-12 05:00:00 ]]>
</FL>
<FL val="ISVOICENOTES">
<![CDATA[ false ]]>
</FL>

</row>
</Notes>
</result>
</response>