接口描述
请求方式:
GET请求地址:
https://api.account.tencent.com/openapi/v3/contacts/departments/{department_id}/direct_children本接口用于游标分页查询指定部门的直属子部门列表。
输入参数
请求头
名称 | 类型 | 必填 | 描述 |
Authorization | string | 是 | 值格式: Bearer {{access_token}} 支持鉴权类型: |
Content-Type | string | 是 | 固定值: application/json; charset=utf-8 |
路径参数
名称 | 类型 | 必填 | 描述 |
department_id | uint64 | 是 | 部门 ID 示例值:"13580************31" |
Query 参数
名称 | 类型 | 必填 | 描述 |
page_size | int | 否 | 每页数量,隐式必填 示例值:20 |
page_token | string | 否 | 分页游标,首页不传;下一页填上一次返回的 page_token 示例值:"CgU3MzkwOA==" |
输出参数
参数名称 | 类型 | 描述 |
departments | array<object> | 子部门列表 |
└ department_id | string | 部门 ID |
└ department_name | string | 部门名称 |
has_more | bool | 是否还有下一页 |
page_token | string | 下一页游标 |
trace_id | string | 唯一请求 ID |
示例
输入示例
GET https://api.account.tencent.com/openapi/v3/contacts/departments/13580************31/direct_children?page_size=20Authorization: Bearer {access_token}
输出示例
成功示例
{"code": 0,"msg": "ok","trace_id": "887511a7470fb5d21d3ec8287f1a24c5","data": {"has_more": true,"page_token": "CgU3MzkwOA==","departments": [{ "department_id": "1358023618608498524", "department_name": "设计部" },{ "department_id": "1383020152903172106", "department_name": "前端开发部" },{ "department_id": "1403541035723793280", "department_name": "后端开发部" }]}}
page_size 缺失时
{"code": 10030,"msg": "[pageSize]页面大小不正确","trace_id": "...","data": null}
说明:
HTTP 状态码为 400。
错误码
说明:
错误码 | 描述 |
201001 | 部门【%s】不存在 |
201017 | 企业部门查询失败,请重试 |
10030 | 参数不正确(page_size 缺失或越界时返回,HTTP 400) |