Skip to content

查询子部门列表

适用版本>=v7.0.2305a.20230511

接口说明:获取子部门列表

请求说明

请求地址配置域名+/graph+/v7/depts/{dept_id}/children
请求方法GET
签名方式WPS-4签名/WPS-4-GM签名(配置域名+/graph不参与签名)
权限要求通讯录查询(企业授权) kso.contacts.read

请求头(Header)

名称是否必填说明
Content-Type固定为: application/json
Wps-Docs-Date取当前时间,示例: Wed,23 Jan 2013 06:43:08 GMT
Wps-Docs-Authorization计算方法参考签名说明
Authorization授权凭证,格式为: Bearer {access_token}

路径参数(Path)

名称类型是否必填说明
dept_idstring部门id,字符串长度不超过128位

查询参数(Query)

名称参数类型是否必填说明
recursivebooleantrue: 递归查询子部门 false: 不递归查询子部门 默认为:false
page_sizeinteger分页大小,默认为:10,最大值:50
page_tokenstring分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回next_page_token作为新的page_token,下次遍历可采用该page_token获取查询结果
with_totalbooleantrue: 返回总记录数 false: 不返回总记录数 默认为:false

响应体(Response)

名称类型说明
codeintegercode
detailstringdetail
msgstringmsg
dataobject返回信息体
itemsobject[]部门信息
abs_pathstring绝对路径
ctimeinteger创建时间,时间戳,单位为秒
ex_dept_idstring部门外部id,可以是外部身份源的ID,
idstring部门id,字符串长度不超过128位
namestring部门名称,字符串长度不超过128位
orderinteger排序值
parent_idstring父部门id,字符串长度不超过128位
leadersobjects[]部门领导id
orderint64排序值
user_idstring部门领导user_id
next_page_tokenstring下一页token;当查询结果中next_page_token为空或无该返回值时,代表无下一页
totalinteger总数

响应体示例

{
  "code": 0,
  "detail": "string",
  "msg": "string",
  "data": {
    "items": [
      {
        "abs_path": "string",
        "ctime": 0,
        "ex_dept_id": "string",
        "id": "string",
        "name": "string",
        "order": 0,
        "parent_id": "string"
        "leaders": [
          {
            "order": 0,
            "user_id": "string"
          }
        ]
      }
    ],
    "next_page_token": "string",
    "total": 0
  }
}