接口描述
请求方式:
GET请求地址:
https://api.account.tencent.com/openapi/v3/contacts/departments/roots本接口用于查询企业的根部门列表。
输入参数
请求头
名称 | 类型 | 必填 | 描述 |
Authorization | string | 是 | 值格式: Bearer {{access_token}} 支持鉴权类型: |
Content-Type | string | 是 | 固定值: application/json; charset=utf-8 |
输出参数
参数名称 | 类型 | 描述 |
roots | array<object> | 根部门列表 |
└ department_id | string | 根部门 ID |
└ department_name | string | 根部门名称 |
└ has_child | bool | 是否存在子部门 |
└ can_choose | bool | 是否在应用可见范围内;为 false 时不返回该字段 |
trace_id | string | 唯一请求 ID |
示例
输入示例
GET https://api.account.tencent.com/openapi/v3/contacts/departments/rootsAuthorization: Bearer {access_token}
输出示例
{"code": 0,"msg": "ok","trace_id": "d5b695a38a1393765896f369b1f19b87","data": {"roots": [{"department_id": "13580************31","department_name": "张三集团","has_child": true}]}}
错误码
说明:
错误码 | 描述 |
201001 | 部门【%s】不存在 |
201017 | 企业部门查询失败,请重试 |