# 获取员工列表 V2

# 中台代码

GetQwUserListV2

# 请求方式

POST

# 请求参数

# 示例

https://xxxx.com/xxxx

# 说明

参数 类型 必须 说明
app_id string 企微中台应用 id
user_id string 接入方后台用户 id。用于接入方控制数据权限,此值是在嵌入页面插件时获取登录 Ticket 时传给企微中台
为空或不传时应返回所有后台用户的员工数据
project_ids string[] 项目 id 列表
为空或不传时应返回所有项目的员工数据
scene int 场景值。说明企微中台在何处调用该接口:0-默认;1-拦截规则成员设置
{
  "app_id": "xxx",
  "user_id": "xxx",
  "project_ids": ["xxx", "xxx"],
  "scene": 0
}

# 返回参数

# 示例

{
  "errcode": 0,
  "errmsg": "ok",
  "departments": [
    {
      "deptId": "部门001",
      "deptName": "部门名称001",
      "departments": [
        {
          "deptId": "部门001-子部门001",
          "deptName": "子部门001",
          "departments": [],
          "qwUsers": []
        }
      ],
      "qwUsers": [
        {
          "userId": "zhouyong",
          "userName": "周勇",
          "roles": [
            {
              "roleName": "经纪人"
            },
            {
              "roleName": "行销"
            }
          ]
        }
      ]
    }
  ],
  "qwUsers": [
    {
      "userId": "wangm",
      "userName": "王明",
      "roles": [
        {
          "roleName": "经纪人"
        }
      ]
    }
  ]
}

# 说明

参数 类型 必须 说明
departments.deptId string 部门 id
departments.deptName string 部门名称
departments.departments object[] 子部门列表
departments.qwUsers object[] 部门内的员工列表
qwUsers.userId string 企微员工 id
qwUsers.userName string 员工姓名
qwUsers.roles.roleName string 员工所属角色名称