获取关联组织部门详情
获取对方的关联组织部门详情,需要对部门有可见性权限才可以获取。
提示
使用 user_access_token 时,按照 admin 管理后台关联组织列表中针对用户设置的可见性规则进行校验,使用 tenant_access_token 时,按照应用互通界面中针对应用设置的可见性规则进行校验。
请求
| 项目 | 值 |
|---|---|
| HTTP URL | https://open.feishu.cn/open-apis/trust_party/v1/collaboration_tenants/:target_tenant_key/collaboration_departments/:target_department_id |
| HTTP Method | GET |
| 接口频率限制 | 5 次/秒 |
| 支持的应用类型 | custom,isv |
| 权限要求 调用该 API 所需的权限。开启其中任意一项权限即可调用 | trust_party:collaboration.tenant:readonly 以应用身份读取关联组织 |
请求头
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| Authorization | string | 是 | tenant_access_token 或 user_access_token 值格式:"Bearer access_token" 示例值:"Bearer u-7f1bcd13fc57d46bac21793a18e560" 了解更多:如何选择与获取 access token |
路径参数
| 名称 | 类型 | 描述 |
|---|---|---|
target_tenant_key | string | 对方关联组织的tenant key,可通过管理员获取所有关联组织列表获取 示例值:"4e6ac4d14bcd5071a37a39de902c7141" |
target_department_id | string | 对方关联组织的部门,需要与target_department_id_type中填写的值保持一致 示例值:"od-4e6ac4d14bcd5071a37a39de902c7141" |
查询参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
target_department_id_type | string | 否 | 对方关联组织的入参部门类型 示例值:department_id 可选值有: - department_id: 部门ID - open_department_id: 部门open ID默认值: department_id |
响应
响应体
| 名称 | 类型 | 描述 |
|---|---|---|
code | int | 错误码,非 0 表示失败 |
msg | string | 错误描述 |
data | \- | - |
└ target_department | collaboration_department | 对方关联组织的部门 |
└ open_department_id | string | 关联组织的部门open id |
└ department_id | string | 关联组织的部门id |
└ name | string | 关联组织的部门名称 |
└ i18n_name | i18n_name | 关联组织的的国际化部门名称 |
└ zh_cn | string | 中文名 |
└ ja_jp | string | 日文名 |
└ en_us | string | 英文名 |
└ order | string | 关联组织的部门排序 |
└ leaders | collaboration_department_leader\[\] | 部门负责人,必须对负责人有可见性权限才会返回 |
└ leader_type | int | 负责人类型 可选值有: - 1: 主负责人 - 2: 副负责人 |
└ id | collaboration_user_id | 负责人ID |
└ user_id | string | 用户ID |
└ open_id | string | 用户open ID |
└ union_id | string | 用户union ID |
└ parent_department_id | collaboration_department_id | 父部门ID,必须对父部门有可见性权限才会返回 |
└ department_id | string | 部门ID |
└ open_department_id | string | 部门open ID |
响应体示例
json
{
"code": 0,
"msg": "success",
"data": {
"target_department": {
"open_department_id": "od-4e6ac4d14bcd5071a37a39de902c7141",
"department_id": "902c7141",
"name": "测试部门",
"i18n_name": {
"zh_cn": "zh_cn_name",
"ja_jp": "ja_jp_name",
"en_us": "en_name"
},
"order": "2000",
"leaders": [
{
"leader_type": 1,
"id": {
"user_id": "1dfsads",
"open_id": "ou_8b8d8b4e310575fd7e4947cf6f1402ac",
"union_id": "on_cad4860e7af114fb4ff6c5d496d1dd76"
}
}
],
"parent_department_id": {
"department_id": "902c7141",
"open_department_id": "od-4e6ac4d14bcd5071a37a39de902c7141"
}
}
}
}错误码
| HTTP状态码 | 错误码 | 描述 | 排查建议 |
|---|---|---|---|
| 400 | 1971001 | User not visible to target tenant. | 无权限查询,请咨询对方组织管理员配置该用户对关联组织的可见 |
| 400 | 1971002 | User not visible to target department. | 无权限查询,请咨询我方管理员配置你对该部门的可见 |
| 400 | 1971007 | App not visible to target tenant. | 请在应用共享设置中配置对关联组织可用 |
| 400 | 1971008 | App not visible to target department | 请在应用共享设置中配置应用对关联部门的可见 |
