Get Locations
Table of Contents
Note:
- This task is applicable to all services except Zoho Creator.
- Each time the zoho.directory.getLocations integration task is executed, it triggers an API request in the back-end. This call is deducted from the external calls limit available for the service from which the task is executed, based on your pricing plan.
- Only actual executions that receive a response (whether success or failure) are counted, not the number of times the task appears in the script. For example, if zoho.directory.getLocations integration task is placed inside a for each task that iterates five times, the number of external calls consumed will be five, even though the task appears only once in the script.
Overview
The zoho.directory.getLocations task is used to fetch all locations from the specified organization.
Syntax
<response> = zoho.directory.getLocations(<orgID>, <page>, <perPage>, <connectionName>);
Scope
ZohoDirectory.Orgs.READ where:
| Parameter | Description | Data type |
| response | is the variable which will hold the details of the locations fetched from the organization. | KEY-VALUE |
| <orgID> | is the ID of the organization from which the locations need to be fetched. | NUMBER |
| <connectionName> | is the name of the Zoho Directory connection. | TEXT |
| <page> | To get the list of records based on pages. | NUMBER |
| <per_page> | Maximum number of records (1-200) in a single page. | NUMBER |
Example
The following script fetches the locations of the first 200 users from Zoho Directory organization:
response = zoho.directory.getLocations(72XXXXXXX, "1", "200", "zoho_directory_connection");
where:
response72XXXXXXXzoho_directory_connection1200{
"status_code": 200,
"locations": [
{
"street_address": "2***",
"country": "p*",
"location_name": "C*****",
"address_type": 1,
"is_primary": true,
"city": "***",
"timezone": "E**********",
"state": "*******",
"postal_code": "9******",
"location_id": "C*****"
},
{
"street_address": "n******",
"country": "i*",
"location_name": "D****",
"address_type": 1,
"is_primary": false,
"city": "****",
"timezone": "P*********",
"language": "a***",
"state": "******",
"postal_code": "*******",
"location_id": "d*******"
},....
],
"has_more": false,
"resource_name": "locations"
}