获取关联组织成员详情
获取关联组织成员详情,需要对关联组织成员有权限才可以获取。
提示
使用 user_access_token 时,按照 admin 管理后台关联组织列表中针对用户设置的可见性规则进行校验,使用 tenant_access_token 时,按照应用互通界面中针对应用设置的可见性规则进行校验。
请求
| 项目 | 值 |
|---|---|
| HTTP URL | https://open.feishu.cn/open-apis/trust_party/v1/collaboration_tenants/:target_tenant_key/collaboration_users/:target_user_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_user_id | string | 请求的关联组织用户ID,需要与target_user_id_type中填写的类型保持一致 示例值:"od-4e6ac4d14bcd5071a37a39de902c7141" |
查询参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
target_user_id_type | string | 否 | 用户ID类型,可以在获取关联组织的部门和成员信息中获取对应的用户ID 示例值:user_id 可选值有: - user_id: 以user_id来识别用户 - union_id: 以union_id来识别用户 - open_id: 以open_id来识别用户默认值: user_id |
响应
响应体
| 名称 | 类型 | 描述 |
|---|---|---|
code | int | 错误码,非 0 表示失败 |
msg | string | 错误描述 |
data | \- | - |
└ target_user | collaboration_user | 关联组织用户 |
└ open_id | string | 对方关联组织用户的open_id |
└ user_id | string | 对方关联组织用户的id |
└ union_id | string | 对方关联组织用户的union id |
└ name | string | 用户的名称 |
└ i18n_name | i18n_name | 关联组织的的国际化用户名称 |
└ zh_cn | string | 中文名 |
└ ja_jp | string | 日文名 |
└ en_us | string | 英文名 |
└ avatar | avatar_info | 用户头像信息 |
└ avatar_72 | string | 72*72像素头像链接 |
└ avatar_240 | string | 240*240像素头像链接 |
└ avatar_640 | string | 640*640像素头像链接 |
└ avatar_origin | string | 原始头像链接 |
└ mobile | string | 手机号,需要对方租户授权展示. |
└ status | user_status | 用户状态 |
└ is_frozen | boolean | 是否冻结 |
└ is_resigned | boolean | 是否离职 |
└ is_activated | boolean | 是否激活 |
└ is_exited | boolean | 是否主动退出,主动退出一段时间后用户会自动转为已离职 |
└ is_unjoin | boolean | 是否未加入,需要用户自主确认才能加入团队 |
└ department_ids | string\[\] | 用户所属部门的ID列表,已废弃 |
└ leader_user_id | string | 用户的直接主管的用户ID,已废弃 |
└ job_title | string | 职务,需要对方租户授权展示. |
└ custom_attrs | user_custom_attr\[\] | 自定义属性,需要对方租户授权展示. |
└ type | string | 自定义属性类型 |
└ id | string | 自定义属性ID |
└ value | user_custom_attr_value | 自定义属性取值 |
└ text | string | 属性文本 |
└ url | string | URL |
└ pc_url | string | PC上的URL |
└ option_value | string | 选项值 |
└ picture_url | string | 图片链接 |
└ name | string | 名称 |
└ generic_user | custom_attr_generic_user | 用户信息 |
└ id | string | 用户id |
└ type | int | 用户类型,枚举值: - 1: 用户 - 2: 机器人 - 11: Mail |
└ employee_no | string | 工号,需要对方租户授权展示 |
└ parent_department_ids | collaboration_department_id\[\] | 父部门ID,必须对父部门有权限才会返回 |
└ department_id | string | 部门ID |
└ open_department_id | string | 部门open ID |
└ leader_id | collaboration_user_id | 用户的leader,必须对leader有权限才会返回 |
└ user_id | string | 用户ID |
└ open_id | string | 用户open ID |
└ union_id | string | 用户union ID |
响应体示例
json
{
"code": 0,
"msg": "success",
"data": {
"target_user": {
"open_id": "ou_4e6ac4d14bcd5071a37a39de902c7141",
"user_id": "902c7141",
"union_id": "on_cad4860e7af114fb4ff6c5d496d1dd76",
"name": "test_name",
"i18n_name": {
"zh_cn": "zh_cn_name",
"ja_jp": "ja_jp_name",
"en_us": "en_name"
},
"avatar": {
"avatar_72": "https://foo.icon.com/xxxx",
"avatar_240": "https://foo.icon.com/xxxx",
"avatar_640": "https://foo.icon.com/xxxx",
"avatar_origin": "https://foo.icon.com/xxxx"
},
"mobile": "+41446681800",
"status": {
"is_frozen": false,
"is_resigned": false,
"is_activated": true,
"is_exited": true,
"is_unjoin": false
},
"department_ids": [
"od-4e6ac4d14bcd5071a37a39de902c7141"
],
"leader_user_id": "ou_7dab8a3d3cdcc9da365777c7ad535d62",
"job_title": "顾问",
"custom_attrs": [
{
"type": "ENUMERATION",
"id": "C-7245579267802529811",
"value": {
"text": "文本1",
"url": "https://www.feishu.cn",
"pc_url": "https://www.feishu.cn",
"option_value": "v2_d9033c89-a483-4efa-8d17-d02340fb16dj",
"picture_url": "https://www.xxxx.com/~?image_size=noop&cut_type=&quality=&format=png&sticker_format=.webp",
"name": "名字",
"generic_user": {
"id": "123456789",
"type": 1
}
}
}
],
"employee_no": "121212",
"parent_department_ids": [
{
"department_id": "902c7141",
"open_department_id": "od-4e6ac4d14bcd5071a37a39de902c7141"
}
],
"leader_id": {
"user_id": "1dfsads",
"open_id": "ou_8b8d8b4e310575fd7e4947cf6f1402ac",
"union_id": "on_cad4860e7af114fb4ff6c5d496d1dd76"
}
}
}
}错误码
| HTTP状态码 | 错误码 | 描述 | 排查建议 |
|---|---|---|---|
| 400 | 1971001 | User not visible to target tenant. | 无权限查询该用户,请咨询对方组织管理员配置该用户对关联组织的可见 |
| 400 | 1971010 | User not visible to target user. | 无权限查询该用户,请咨询我方管理员配置你对该用户的可见 |
| 400 | 1971007 | App not visible to target tenant. | 请在应用共享设置中配置对关联组织可用 |
| 400 | 1971009 | App not visible to target user. | 请在应用共享设置中配置应用对关联用户的可见 |
