创建用户
创建新用户
请求说明
| 请求地址 | https://openapi.wps.cn/v7/users/create |
|---|---|
| 请求方法 | POST |
| 签名方式 | KSO-1 |
| 权限要求 | 查询和管理通讯录信息(应用授权) kso.contact.readwrite |
请求头(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)
| 名称 | 参数类型 | 是否必填 | 说明 |
|---|---|---|---|
| city | string | 否 | 城市 |
| country | string | 否 | 国家 |
| dept_ids | array[string] | 是 | 加入的部门 id |
| string | 否 | 邮箱 | |
| employee_id | string | 否 | 工号 |
| employer | string | 否 | 就职单位 |
| employment_status | string | 否 | 员工状态。probationary:试用。 |
| employment_type | string | 否 | 员工类型。 普通企业: permanent: 正式; intern: 实习。教育企业: teacher:教师;student:学生;staff:教职工;employee:聘用人员;alumni:校友;other:其他 |
| gender | string[enum] | 否 | 性别 male:男性;female:女性;secrecy:保密 |
| leader_id | string | 否 | 直属主管的用户ID |
| phone | string | 否 | 手机号码 |
| telephone | string | 否 | 座机 |
| title | string | 否 | 职务信息 |
| user_name | string | 是 | 用户名称 |
| work_place | string | 否 | 办公地点 |
| def_dept_id | string | 否 | 主部门id |
| ex_user_id | string | 否 | 外部身份源ID |
请求地址示例
[POST] https://openapi.wps.cn/v7/users/create请求体示例
json
{
"city": "string",
"country": "string",
"dept_ids": ["string"],
"email": "string",
"employee_id": "string",
"employer": "string",
"employment_status": "string",
"employment_type": "string",
"gender": "string[enum]",
"leader_id": "string",
"phone": "string",
"telephone": "string",
"title": "string",
"user_name": "string",
"work_place": "string",
"def_dept_id":"string",
"ex_user_id": "string"
}响应体
| 名称 | 参数类型 | 说明 |
|---|---|---|
| code | integer | 响应代码。非 0 表示失败,参照《状态码说明》 |
| msg | string | 响应信息 |
| data | 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 |
| ∟ login_name | string | 登录名 |
| ∟ 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 | 办公地点 |
响应体示例
json
{
"data": {
"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",
"login_name": "string",
"phone": "string",
"role": "string[enum]",
"status": "string[enum]",
"telephone": "string",
"title": "string",
"user_name": "string",
"work_place": "string"
},
"msg": "string",
"code": 0
}