批量查询用户
基于 user_id 数组批量查询用户
请求说明
| 请求地址 | https://openapi.wps.cn/v7/users/batch_read |
|---|---|
| 请求方法 | POST |
| 签名方式 | KSO-1 |
| 权限要求 | 查询和管理通讯录信息(应用授权) kso.contact.readwrite查询通讯录信息(应用授权) kso.contact.read |
请求头(Header)
| Header 名称 | 参数类型 | 是否必填 | 说明 |
|---|---|---|---|
| Content-Type | string | 是 | 使用:application/json |
| X-Kso-Date | string | 是 | RFC1123 格式的日期,例: Wed, 23 Jan 2013 06:43:08 GMT |
| X-Kso-Authorization | string | 是 | KSO-1 签名值,详见《签名方法》 |
| Authorization | string | 是 | 授权凭证,格式为:Bearer {access_token} |
请求体(Body)
| 名称 | 参数类型 | 是否必填 | 说明 |
|---|---|---|---|
| status | array[string] | 是 | 状态,必填。可选值:active:正常;notactive:未激活;disabled:禁用 |
| user_ids | array[string] | 是 | 用户id列表 |
| with_dept | boolean | 否 | 是否需要返回部门信息,可选值:true(返回部门信息),false(不返回部门信息),默认为false |
请求地址示例
[POST] https://openapi.wps.cn/v7/users/batch_read请求体示例
json
{
"status": ["string"],
"user_ids": ["string"],
"with_dept": false
}响应体
| 名称 | 参数类型 | 说明 |
|---|---|---|
| code | integer | 响应代码。非 0 表示失败,参照《状态码说明》 |
| msg | string | 响应信息 |
| data | object | 响应数据 |
| ∟ items | array[object] | 用户信息列表 |
| ∟ ∟ city | string | 城市 |
| ∟ ∟ country | string | 国家 |
| ∟ ∟ ctime | integer | 创建时间 |
| ∟ ∟ depts | array[object] | 部门信息 |
| ∟ ∟ ∟ abs_path | string | 绝对路径 |
| ∟ ∟ ∟ id | string | 部门 id |
| ∟ ∟ ∟ name | string | 部门名称 |
| string | 邮箱 需额外获取字段权限:查询用户的邮箱(应用授权) kso.user_email.read | |
| ∟ ∟ employee_id | string | 工号 |
| ∟ ∟ employer | string | 就职单位 |
| ∟ ∟ employment_status | string | 员工状态。probationary:试用。 |
| ∟ ∟ employment_type | string | 员工类型。 普通企业: permanent: 正式; intern: 实习。教育企业: teacher:教师;student:学生;staff:教职工;employee:聘用人员;alumni:校友;other:其他 |
| ∟ ∟ ex_user_id | string | 外部身份源ID |
| ∟ ∟ gender | string[enum] | 性别 undefined:未设置;male:男性;female:女性;secrecy:保密需额外获取字段权限:查询用户的性别(应用授权) kso.user_gender.read |
| ∟ ∟ id | string | 用户 id,自动生成 |
| ∟ ∟ leader_id | string | 直属主管的用户id |
| ∟ ∟ phone | string | 手机号码 需额外获取字段权限:查询用户的手机号(应用授权) kso.user_phone.read |
| ∟ ∟ role | string[enum] | 用户角色 super-admin:超级管理员;admin:普通管理员;normal:普通用户 |
| ∟ ∟ status | string[enum] | 用户状态 active:正常;notactive:未激活;disabled:禁用;dimission:离职 |
| ∟ ∟ telephone | string | 座机 |
| ∟ ∟ title | string | 职务信息 |
| ∟ ∟ user_name | string | 用户名称 |
| ∟ ∟ work_place | string | 办公地点 |
| ∟ ∟ def_dept_id | string | 主部门id |
响应体示例
json
{
"data": {
"items": [
{
"city": "string",
"country": "string",
"ctime": 0,
"depts": [
{
"abs_path": "string",
"id": "string",
"name": "string"
}
],
"email": "string",
"employee_id": "string",
"employer": "string",
"employment_status": "string",
"employment_type": "string",
"ex_user_id": "string",
"gender": "string[enum]",
"id": "string",
"leader_id": "string",
"phone": "string",
"role": "string[enum]",
"status": "string[enum]",
"telephone": "string",
"title": "string",
"user_name": "string",
"work_place": "string",
"def_dept_id": "string"
}
]
},
"msg": "string",
"code": 0
}