# Get location list

The interface is used to query location information in batches according to location ID, including location name, description, location purpose, working hours system, regional setting, time zone and associated address information.

**Notice**：- Delay description: The delay of the database leader/follower is within 2s, that is, the data may not be queried by calling this interface within 2s after the location is directly created.

## Request

Facts | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/corehr/v1/locations
HTTP Method | GET
Rate Limit | [100 per minute](https://open.feishu.cn/document/ukTMukTMukTM/uUzN04SN3QjL1cDN)
Supported app types | Custom App、Store App
Required scopes<br>**To use this API, you must have at least 1 of the listed scopes.**<br>Enable any scope from the list | Obtain core HR information(corehr:corehr:readonly)<br>Get location information(corehr:locations:read)<br>Update core HR information(corehr:corehr)<br>Update location information(corehr:locations:write)

### Request header

Parameter | Type | Required | Description
---|---|---|---
Authorization | string | Yes | `tenant_access_token`<br>**Value format**: "Bearer `access_token`"<br>**Example value**: "Bearer t-7f1bcd13fc57d46bac21793a18e560"<br>[How to choose and get access token](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-choose-which-type-of-token-to-use)

### Query parameters

Parameter | Type | Required | Description
---|---|---|---
page_token | string | No | Page identifier. It is not filled in the first request, indicating traversal from the beginning; when there will be more groups, the new page_token will be returned at the same time, and the next traversal can use the page_token to get more groups<br>**Example value**: 1231231987
page_size | string | Yes | Page size<br>**Example value**: 100

## Response

### Response body

Parameter | Type | Description
---|---|---
code | int | Error codes, fail if not zero
msg | string | Error descriptions
data | \- | \-
items | location\[\] | Location information for inquiries
id | string | The location record ID maintained by the location maintenance administrator in the Feishu personnel system, organization management module.
hiberarchy_common | hiberarchy_common | Location basic information, the structure maintains the name of the location, code, enable status, location, and other basic information.
parent_id | string | The superior location<br>- in the creation of the scene, this field is required, and the enumeration value and detailed information can be obtained through the [Query Location List](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/location/list) interface query<br>- This field will not be displayed if the query is for a first-level location
name | i18n\[\] | name
lang | string | language<br>- Chinese with zh-CN, English with en-US.
value | string | content
type | enum | Organization type
enum_name | string | Organization type, the default value is location, enumeration value and detailed information can be obtained by [batch query enumeration type](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/feishu-people-enum-constant) interface query
display | i18n\[\] | enumerated multilingual display
lang | string | language<br>- Chinese with zh-CN, English with en-US.
value | string | content
active | boolean | enable
effective_time | string | Effective time<br>- Fill in the format: YY-MM-DD 00:00:00<br>- Effective time, the system defaults to 00:00:00 on the day of filling in the date.
expiration_time | string | Expiration time<br>- Fill in the format: YYYY-MM-DD 00:00:00<br>The time when the edited version of the record expires. If the user modifies the location information after the effective date of this operation, the system will use the date of the next operation as the expiration time of the current record.<br>- The system defaults to 00:00:00 on the day of filling in the date.
code | string | Code， The unique value in the system for API usage。
description | i18n\[\] | description
lang | string | language<br>- Chinese with zh-CN, English with en-US.
value | string | content
custom_fields | object_field_data\[\] | Custom fields
field_name | string | field name
value | string | The field value is the string escaped by json. According to the metadata definition, the field format is different. For example ：```("\" 123 \"", "\" 123.23 \"", "\" true \"", [\" id1\ ",\" id2 \"], \" 2006-01-02 15:04:05\ ")```
location_usage_list | enum\[\] | Location usage
enum_name | string | The enumeration value, location use ID, enumeration value and detailed information can be obtained through the [Batch Query Location Use](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/feishu-people-enum-constant) interface query
display | i18n\[\] | enumerated multilingual display
lang | string | language<br>- Chinese with zh-CN, English with en-US.
value | string | content
address | address\[\] | Address
full_address_local_script | string | Full address (local script)
full_address_western_script | string | Full address (Western script)
id | string | Address ID
country_region_id | string | Country ID<br>It can be obtained through the [Query country/region information](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/corehr-v2/basic_info-country_region/search) interface
region_id | string | Main administrative region ID<br>It can be obtained through the [Query Province/Administrative Region Information](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/corehr-v2/basic_info-country_region_subdivision/search) interface
city_id | string | City ID
distinct_id | string | Distinct ID
address_line1 | string | Address line 1
address_line2 | string | Address line 2
address_line3 | string | Address line 3
address_line4 | string | Address line 4
address_line5 | string | Address line 5
address_line6 | string | Address line 6
address_line7 | string | Address line 7
address_line8 | string | Address line 8
address_line9 | string | Address line 9
local_address_line1 | string | Address line 1 (non-Latin native script)
local_address_line2 | string | Address line 2 (non-Latin native scripts)
local_address_line3 | string | Address line 3 (non-Latin native scripts)
local_address_line4 | string | Address line 4 (non-Latin native scripts)
local_address_line5 | string | Address line 5 (non-Latin native script)
local_address_line6 | string | Address line 6 (non-Latin native script)
local_address_line7 | string | Address line 7 (non-Latin native scripts)
local_address_line8 | string | Address line 8 (non-Latin native script)
local_address_line9 | string | Address line 9 (non-Latin native script)
postal_code | string | Postal Code
address_type_list | enum\[\] | Address type
enum_name | string | The enumeration value can be queried through the [Get Field Details](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/custom_field/get_by_param) interface. The query parameters are as follows:<br>- object_api_name = "address"<br>- custom_api_name = "address_type"
display | i18n\[\] | enumerated multilingual display
lang | string | language<br>- Chinese with zh-CN, English with en-US.
value | string | content
is_primary | boolean | Main address
is_public | boolean | public address
custom_fields | object_field_data\[\] | Custom fields
field_name | string | field name
value | string | The field value is the string escaped by json. According to the metadata definition, the field format is different. For example ：```("\" 123 \"", "\" 123.23 \"", "\" true \"", [\" id1\ ",\" id2 \"], \" 2006-01-02 15:04:05\ ")```
working_hours_type_id | string | The working hour system ID, enumeration value and detailed information can be obtained through the [batch query working hour system](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/list) interface query
effective_time | string | Effective time<br>- Fill in the format: YY-MM-DD 00:00:00<br>- Effective time, the system defaults to 00:00:00 on the day of filling in the date.
expiration_time | string | Expiration time<br>- Fill in the format: YYYY-MM-DD 00:00:00<br>The time when the edited version of the record expires. If the user modifies the location information after the effective date of this operation, the system will use the date of the next operation as the expiration time of the current record.<br>- The system defaults to 00:00:00 on the day of filling in the date.
custom_fields | object_field_data\[\] | Custom fields
field_name | string | field name
value | string | The field value is the string escaped by json. According to the metadata definition, the field format is different. For example ：```("\" 123 \"", "\" 123.23 \"", "\" true \"", [\" id1\ ",\" id2 \"], \" 2006-01-02 15:04:05\ ")```
locale | enum | Locale ID, enumeration value and detailed information can be obtained by [Batch query enumeration information](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/feishu-people-enum-constant) interface query
enum_name | string | enumeration value
display | i18n\[\] | enumerated multilingual display
lang | string | language<br>- Chinese with zh-CN, English with en-US.
value | string | content
time_zone_id | string | Time Zone
display_language_id | string | Default display language
has_more | boolean | Whether the response body has more parameters
page_token | string | Page identifier, when has_more is true, a new page_token will also be returned. Otherwise, page_token will not be returned

### Response body example
```json
{
    "code": 0,
    "msg": "success",
    "data": {
        "items": [
            {
                "id": "4718803945687580505",
                "hiberarchy_common": {
                    "parent_id": "4719168654814483759",
                    "name": [
                        {
                            "lang": "zh-CN",
                            "value": "刘梓新"
                        }
                    ],
                    "type": {
                        "enum_name": "Location",
                        "display": [
                            {
                                "lang": "zh-CN",
                                "value": " location"
                            }
                        ]
                    },
                    "active": true,
                    "effective_time": "2020-05-01 00:00:00",
                    "expiration_time": "2020-05-02 00:00:00",
                    "code": "12456",
                    "description": [
                        {
                            "lang": "zh-CN",
                            "value": "刘梓新"
                        }
                    ],
                    "custom_fields": [
                        {
                            "field_name": "name",
                            "value": "\"Sandy\""
                        }
                    ]
                },
                "location_usage_list": [
                    {
                        "enum_name": "work_location",
                        "display": [
                            {
                                "lang": "zh-CN",
                                "value": "workplace"
                            }
                        ]
                    }
                ],
                "address": [
                    {
                        "full_address_local_script": "中国北京北京",
                        "full_address_western_script": "Beijing, Beijing, China,",
                        "id": "6989822217869624863",
                        "country_region_id": "6862995757234914824",
                        "region_id": "6863326815667095047",
                        "city_id": "6863333254578046471",
                        "distinct_id": "6863333516579440141",
                        "address_line1": "丹佛测试地址-纽埃时区",
                        "address_line2": "PoewH",
                        "address_line3": "PoewH",
                        "address_line4": "jmwJc",
                        "address_line5": "jmwJc",
                        "address_line6": "jmwJc",
                        "address_line7": "jmwJc",
                        "address_line8": "rafSu",
                        "address_line9": "McPRG",
                        "local_address_line1": "丹佛测试地址-纽埃时区",
                        "local_address_line2": "New York",
                        "local_address_line3": "New York",
                        "local_address_line4": "New York",
                        "local_address_line5": "New York",
                        "local_address_line6": "New York",
                        "local_address_line7": "New York",
                        "local_address_line8": "New York",
                        "local_address_line9": "New York",
                        "postal_code": "611530",
                        "address_type_list": [
                            {
                                "enum_name": "onboarding_address",
                                "display": [
                                    {
                                        "lang": "zh-CN",
                                        "value": " onboarding address"
                                    }
                                ]
                            }
                        ],
                        "is_primary": true,
                        "is_public": true,
                        "custom_fields": [
                            {
                                "field_name": "name",
                                "value": "\"Sandy\""
                            }
                        ]
                    }
                ],
                "working_hours_type_id": "4690238309151997779",
                "effective_time": "2020-05-01 00:00:00",
                "expiration_time": "2020-05-02 00:00:00",
                "custom_fields": [
                    {
                        "field_name": "name",
                        "value": "\"Sandy\""
                    }
                ],
                "locale": {
                    "enum_name": "zh_cn",
                    "display": [
                        {
                            "lang": "zh-CN",
                            "value": "刘梓新"
                        }
                    ]
                },
                "time_zone_id": "123456789",
                "display_language_id": "123456789"
            }
        ],
        "has_more": true,
        "page_token": "7094095584361137709"
    }
}
```

