Get Locations

Table of Contents

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:

ParameterDescriptionData type
responseis 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:

response
This is the KEY-VALUEresponse returned by Zoho Directory.
72XXXXXXX
This is the NUMBERthat represents the organization ID of Zoho Directory account from which the location of the users needs to be fetched.
zoho_directory_connection
This is the TEXTthat represents the link name of the connection.
1
This is the NUMBERresponse returned by Zoho Directory.
200
This is the NUMBERthat represents the total number of records that need to be fetched.

Response format

{
    "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"
}