根据邮箱获取用户
适用版本>=v7.0.2402.20240222
接口说明:根据邮箱获取用户信息
请求说明
| 请求地址 | 配置域名+/graph+/v7/users/by_emails |
|---|---|
| 请求方法 | POST |
| 签名方式 | 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} |
请求体(Body)
| 名称 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| emails | string[] | 是 | 用户邮箱,[ 1 .. 100 ] items [ items [ 1 .. 128 ] characters ] |
| status | string[] | 是 | Items Enum: "notactive" "active" "disabled",必填,可选值:active(正常),notactive(未激活),disabled(禁用) |
| with_dept | bool | 否 | 是否返回部门信息 |
请求体示例
{
"emails": [
"string"
],
"status": [
"notactive"
],
"with_dept": true
}响应体(Response)
| 名称 | 类型 | 说明 |
|---|---|---|
| code | integer | code |
| detail | string | detail |
| msg | string | msg |
| data | object | 返回信息体 |
| ∟ items | object[] | 用户简单信息 |
| ∟ ∟ avatar | string | 头像 |
| ∟ ∟ ctime | integer | 创建时间,时间戳,单位为秒 |
| ∟ ∟ depts | object[] | 部门信息 |
| ∟ ∟ ∟ abs_path | string | 绝对路径 |
| ∟ ∟ ∟ id | string | 部门id |
| ∟ ∟ ∟ name | string | 部门名称 |
| string | 邮箱,字符串长度不超过128位 | |
| ∟ ∟ employee_id | string | 工号 |
| ∟ ∟ ex_user_id | string | 用户外部id,可以是用户ID、用户名、邮箱、手机号、外部ID、在外部身份源的ID,为空则默认为用户id |
| ∟ ∟ gender | string | Enum: "secrecy" "male" "female",性别 |
| ∟ ∟ id | string | 用户id,自动生成,字符串长度不超过128位 |
| ∟ ∟ login_name | string | 登录名,字符串长度不超过128位 |
| ∟ ∟ phone | string | 手机 |
| ∟ ∟ status | string | Enum: "notactive" "active" "disabled",用户状态 |
| ∟ ∟ telephone | string | 座机 |
| ∟ ∟ title | string | 职务信息,字符串长度不超过128位 |
| ∟ ∟ user_name | string | 用户名称,字符串长度不超过128位 |
| ∟ ∟ work_place | string | 办公地点 |
| ∟ ∟ role | string | 用户角色super-admin:超级管理员;admin:普通管理员;normal:普通用户; |
响应体示例
json
{
"data": {
"items": [
{
"avatar": "string",
"ctime": 0,
"depts": [
{
"abs_path": "string",
"id": "string",
"name": "string"
}
],
"email": "user@example.com",
"employee_id": "string",
"ex_user_id": "string",
"gender": "secrecy",
"id": "string",
"login_name": "string",
"phone": "string",
"status": "notactive",
"telephone": "string",
"title": "string",
"user_name": "string",
"work_place": "string",
"role": "string"
}
]
},
"code": 0,
"detail": "string",
"msg": "string"
}