Skip to content

查询部门下用户列表

适用版本>=v7.0.2601.20260122

接口说明:获取部门成员列表

标签通讯录

请求说明

字段
请求地址
配置域名+/openapi+/v7/depts/{dept_id}/members
HTTP 方法
GET
接口描述
基于dept_id查询部门下用户列表(调用 创建部门 接口后可从返回结果中获取到部门id;有诸多查询部门信息的API可获取部门id字段,如 获取用户所在部门列表)。仅支持应用身份
签名方式
KSO-1(配置域名+/openapi不参与签名)
限频策略
权限要求
查询和管理通讯录信息(应用授权) kso.contact.readwrite
查询通讯录信息(应用授权) kso.contact.read
查询和管理通讯录信息(用户授权) kso.contact.readwrite
查询通讯录信息(用户授权) kso.contact.read

请求头 (Headers)

属性名类型是否必填描述可选值
X-Kso-Id-Type
string类型
* internal - 内部
* external - 外部
internal, external
X-Kso-Date
stringRFC1123 格式的日期,例: Wed, 23 Jan 2013 06:43:08 GMT-
X-Kso-Authorization
stringKSO-1 签名值,详见《签名方法》-
Authorization
string授权凭证,格式为:Bearer {access_token}-

路径参数 (Path)

属性名类型是否必填描述可选值
dept_id
string-

查询参数 (Query)

属性名类型是否必填描述可选值
recursive
boolean是否递归查询子部门下用户,true:递归查询子部门下用户,false:查询当前部门直属子部门下用户,默认为false-
page_size
integer分页大小,默认为:10,最大值:50-
page_token
string分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的next_page_token,下次遍历可采用该next_page_token获取查询结果-
with_total
boolean是否返回部门下用户总数,true:返回,false:不返回,默认为false-
with_user_detail
boolean是否返回用户详细信息,true:返回,false:不返回,默认为false-
status
array状态,可选值:active(正常),notactive(未激活),disabled(禁用),最多支持3个状态同时查询active, notactive, disabled, dimission
with_dept_detail
boolean是否在dept_member_item中返回部门详细信息,true:返回,false:不返回,默认为false-

响应体(Response)

HTTP状态码: 200
响应体格式: application/json

没有可用的数据

响应体示例

json
{
  "data": {
    "items": [
      {
        "ctime": 0,
        "dept_id": "string",
        "dept_info": {
          "abs_path": "string",
          "id": "string",
          "name": "string"
        },
        "is_leader": true,
        "mtime": 0,
        "order": 0,
        "user_id": "string",
        "user_info": {
          "avatar": "string",
          "city": "string",
          "country": "string",
          "def_dept_id": "string",
          "email": "string",
          "employee_id": "string",
          "employer": "string",
          "employment_status": "string",
          "employment_type": "string",
          "gender": "undefined",
          "id": "string",
          "leader_id": "string",
          "phone": "string",
          "role": "super-admin",
          "source": "inner",
          "status": "active",
          "telephone": "string",
          "title": "string",
          "titles": {
            "mode": "general",
            "title_list": [
              {
                "dept": {
                  "abs_path": "string",
                  "id": "string",
                  "name": "string"
                },
                "id": "string",
                "name": "string"
              }
            ]
          },
          "user_name": "string",
          "work_place": "string"
        }
      }
    ],
    "next_page_token": "string",
    "total": 0
  },
  "code": 0,
  "msg": "string"
}