查询单个地点
该接口用于根据地点 ID查询地点信息,信息包含地点名称、描述、地点用途、工时制度、区域设置、时区以及关联的地址信息等。
Warning: 延迟说明:数据库主从延迟 2s 以内,即:直接创建地点后2s内调用此接口可能查询不到数据。
请求
| 项目 | 值 |
|---|---|
| HTTP URL | https://open.feishu.cn/open-apis/corehr/v1/locations/:location_id |
| HTTP Method | GET |
| 接口频率限制 | 100 次/分钟 |
| 支持的应用类型 | custom,isv |
| 权限要求 调用该 API 所需的权限。开启其中任意一项权限即可调用 开启任一权限即可 | corehr:corehr:readonly 获取核心人事信息 corehr:locations:read 获取地点信息 corehr:corehr 更新核心人事信息 corehr:locations:write 更新地点信息 |
请求头
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| Authorization | string | 是 | tenant_access_token 值格式:"Bearer access_token" 示例值:"Bearer t-7f1bcd13fc57d46bac21793a18e560" 了解更多:如何选择与获取 access token |
路径参数
| 名称 | 类型 | 描述 |
|---|---|---|
location_id | string | 地点维护管理员在 飞书人事系统,组织管理模块维护的地点记录 ID。ID获取方式: - 调用【创建地点】【批量分页查询地点】等接口可以返回地点ID 示例值:"1215" |
响应
响应体
| 名称 | 类型 | 描述 |
|---|---|---|
code | int | 错误码,非 0 表示失败 |
msg | string | 错误描述 |
data | \- | - |
└ location | location | 地点信息 |
└ id | string | 地点维护管理员在 飞书人事系统,组织管理模块维护的地点记录 ID。 |
└ hiberarchy_common | hiberarchy_common | 地点基本信息,该结构维护了地点的名称、编码、启用状态、上级地点 等基础信息。 |
└ parent_id | string | 上级地点ID - 可通过查询单个地点获取详情。 - 若查询的是一级地点,则该字段不展示 |
└ name | i18n\[\] | 名称 |
└ lang | string | 语言 - 中文用zh-CN,英文用en-US。 |
└ value | string | 内容 - 名称不能包含「/」「;」「;」字符 - xx中英文名称会有全局唯一校验 |
└ type | enum | 组织类型 |
└ enum_name | string | 组织类型 ,枚举值及详细信息可通过【批量查询枚举信息】接口查询获得。 - 请求参数object_api_name=organization;custom_api_name=org_type - 该接口返回固定常量location |
└ display | i18n\[\] | 枚举多语展示 |
└ lang | string | 语言 - 中文用zh-CN,英文用en-US。 |
└ value | string | 内容 |
└ active | boolean | 启用 |
└ effective_time | string | 当前版本生效日期 - 返回格式:YYYY-MM-DD 00:00:00(最小单位到日) - 日期范围:1900-01-01 00:00:00~9999-12-31 00:00:00 - 详情可以参考时间轴介绍 - 该字段和data. effective_time返回值相同 |
└ expiration_time | string | 当前版本失效日期 - 返回格式:YYYY-MM-DD 00:00:00(最小单位到日) - 日期范围:1900-01-01 00:00:00~9999-12-31 00:00:00 - 系统默认为失效日期当天的 00:00:00 失效 - 详情可以参考时间轴介绍 |
└ code | string | 编码 |
└ description | i18n\[\] | 描述 |
└ lang | string | 语言 - 中文用zh-CN,英文用en-US。 |
└ value | string | 内容 |
└ custom_fields | object_field_data\[\] | 自定义字段(该功能暂不支持,可忽略) |
└ field_name | string | 字段名 |
└ value | string | 字段值,是json转义后的字符串,根据元数据定义不同,字段格式不同。如:("\"123\"", "\"123.23\"", "\"true\"", [\"id1\",\"id2\"], \"2006-01-02 15:04:05\") |
└ location_usage_list | enum\[\] | 地点用途 |
└ enum_name | string | 地点用途 ID,枚举值及详细信息可通过【批量查询地点用途】接口查询获得。 - 请求参数object_api_name=location;custom_api_name=location_usage |
└ display | i18n\[\] | 枚举多语展示 |
└ lang | string | 语言 - 中文用zh-CN,英文用en-US。 |
└ value | string | 内容 |
└ address | address\[\] | 地址 |
└ full_address_local_script | string | 完整地址(本地文字) |
└ full_address_western_script | string | 完整地址(西方文字) |
└ id | string | 地址ID |
└ country_region_id | string | 国家 / 地区 ID 可通过【查询国家/地区信息】接口获取 |
└ region_id | string | 主要行政区 ID 可通过【查询省份/行政区信息】接口获取 |
└ city_id | string | 城市 |
└ distinct_id | string | 区/县 |
└ address_line1 | string | 地址行 1 |
└ address_line2 | string | 地址行 2 |
└ address_line3 | string | 地址行 3 |
└ address_line4 | string | 地址行 4 |
└ address_line5 | string | 地址行 5 |
└ address_line6 | string | 地址行 6 |
└ address_line7 | string | 地址行 7 |
└ address_line8 | string | 地址行 8 |
└ address_line9 | string | 地址行 9 |
└ local_address_line1 | string | 地址行 1(非拉丁语系的本地文字) |
└ local_address_line2 | string | 地址行 2(非拉丁语系的本地文字) |
└ local_address_line3 | string | 地址行 3(非拉丁语系的本地文字) |
└ local_address_line4 | string | 地址行 4(非拉丁语系的本地文字) |
└ local_address_line5 | string | 地址行 5(非拉丁语系的本地文字) |
└ local_address_line6 | string | 地址行 6(非拉丁语系的本地文字) |
└ local_address_line7 | string | 地址行 7(非拉丁语系的本地文字) |
└ local_address_line8 | string | 地址行 8(非拉丁语系的本地文字) |
└ local_address_line9 | string | 地址行 9(非拉丁语系的本地文字) |
└ postal_code | string | 邮政编码 |
└ address_type_list | enum\[\] | 地址类型 枚举值可通过【获取字段详情】接口查询,查询参数如下: - object_api_name = "address" - custom_api_name = "address_type" |
└ enum_name | string | 枚举值 |
└ display | i18n\[\] | 枚举多语展示 |
└ lang | string | 语言 - 中文用zh-CN,英文用en-US。 |
└ value | string | 内容 |
└ is_primary | boolean | 主要地址 |
└ is_public | boolean | 公开地址 |
└ custom_fields | object_field_data\[\] | 自定义字段 |
└ field_name | string | 字段名 |
└ value | string | 字段值,是json转义后的字符串,根据元数据定义不同,字段格式不同。如:("\"123\"", "\"123.23\"", "\"true\"", [\"id1\",\"id2\"], \"2006-01-02 15:04:05\") |
└ working_hours_type_id | string | 工时制度 ID,枚举值及详细信息可通过【批量查询工时制度】接口查询获得 |
└ effective_time | string | 当前版本生效日期 - 返回格式:YYYY-MM-DD 00:00:00(最小单位到日) - 日期范围:1900-01-01 00:00:00~9999-12-31 00:00:00 - 详情可以参考时间轴介绍 - 该字段和data.hiberarchy_common.effective_time值相同 |
└ expiration_time | string | 当前版本失效日期 - 返回格式:YYYY-MM-DD(最小单位到日) - 日期范围:1900-01-01~9999-12-31 - 详情可以参考时间轴介绍 - 该字段和data.hiberarchy_common.expiration_time值相同 |
└ custom_fields | object_field_data\[\] | 自定义字段(该功能暂不支持,可忽略) |
└ field_name | string | 字段名 |
└ value | string | 字段值,是json转义后的字符串,根据元数据定义不同,字段格式不同。如:("\"123\"", "\"123.23\"", "\"true\"", [\"id1\",\"id2\"], \"2006-01-02 15:04:05\") |
└ locale | enum | 区域设置ID ,枚举值及详细信息可通过【批量查询枚举信息】接口查询获得。 - 请求参数object_api_name=location;custom_api_name=locale |
└ enum_name | string | 枚举值 |
└ display | i18n\[\] | 枚举多语展示 |
└ lang | string | 语言 - 中文用zh-CN,英文用en-US。 |
└ value | string | 内容 |
└ time_zone_id | string | 时区 |
└ display_language_id | string | 默认显示语言 |
响应体示例
json
{
"code": 0,
"msg": "success",
"data": {
"location": {
"id": "4718803945687580505",
"hiberarchy_common": {
"parent_id": "4719168654814483759",
"name": [
{
"lang": "zh-CN",
"value": "刘梓新"
}
],
"type": {
"enum_name": "location",
"display": [
{
"lang": "zh-CN",
"value": " 地点"
}
]
},
"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": "工作地点"
}
]
}
],
"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": " 入职地址"
}
]
}
],
"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"
}
}
}