创建用户 | 大装置帮助中心
跳到主要内容

创建用户

接口描述

POST /v1/users/batch 创建用户

请求头(Request Header)

参考认证(authentication)

请求参数(Request Parameters)

请求体(Request Body)

名称位置类型必须描述
bodybodyAddUsersRequesttruenone

请求示例(Request Example)

curl --request POST \
--url https://example.com/v1/users/batch \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}' \
--header 'Content-Type: application/json' \
--data '{"user":[{"id":"string","name":"string","username":"string","phone":"string","email":"string","tenant_id":"string","tenant_code":"string","region_code":"string","password":"stringst","confirm_password":"string","remark":"string","console_state":"string","open_api_state":"string","mfa_state":"string","set_password_first_login":"string","set_password_next_login":"string","set_password_at_login":"string","ak":{"id":"string","user_id":"string","access_key":"string","secret_key":"string","status":"string","advice_renew":true},"password_updator_id":"string","password_updator_username":"string"}]}'

响应参数(Response Parameters)

StatusMeaningDescriptionSchema
200OKOKAddUsersResponse

响应示例(Response Example)

200 Response

{
"users": [
{
"id": "string",
"name": "string",
"username": "string",
"phone": "string",
"email": "string",
"tenant_id": "string",
"tenant_code": "string",
"region_code": "string",
"status": "string",
"source": "string",
"confirm_password": "string",
"remark": "string",
"console_state": "string",
"open_api_state": "string",
"mfa_state": "string",
"set_password_first_login": "string",
"set_password_next_login": "string",
"set_password_at_login": "string",
"ak": {
"id": "string",
"user_id": "string",
"access_key": "string",
"secret_key": "string",
"status": "string",
"advice_renew": true,
"create_time": "2019-08-24T14:15:22Z",
"update_time": "2019-08-24T14:15:22Z"
},
"set_password_time": "2019-08-24T14:15:22Z",
"last_login_time": "2019-08-24T14:15:22Z",
"create_time": "2019-08-24T14:15:22Z",
"update_time": "2019-08-24T14:15:22Z",
"join_time": "2019-08-24T14:15:22Z",
"password_updator_id": "string",
"password_updator_username": "string",
"invalid_time": "2019-08-24T14:15:22Z",
"message_phone": "string",
"message_email": "string",
"message_phone_verified": true,
"message_email_verified": true
}
]
}

数据结构(Schemas)

AddUsersRequest

名称类型必须限制描述
user[User]truenone需创建的用户列表

AddUsersResponse

名称类型必须限制描述
users[User]falsenone用户列表

Ak

名称类型必须限制描述
idstringfalsenoneAk id
user_idstringfalsenone用户id
access_keystringfalsenoneAccess key
secret_keystringfalsenoneSecret key
statusstringfalsenone状态
advice_renewbooleanfalsenone建议更新标志
create_timestring(date-time)falseread-only创建时间
update_timestring(date-time)falseread-only更新时间

User

名称类型必须限制描述
idstringfalsenone用户id
namestringtruenone显示名称
usernamestringtruenone用户名
phonestringfalsenone手机号
emailstringfalsenone邮箱
tenant_idstringfalsenone租户id
tenant_codestringfalsenone租户标识
region_codestringfalsenone地区代码
statusstringfalseread-only用户状态,取值为['valid','invalid','forbidden']
sourcestringfalseread-only来源,取值为['build_in','ad']
passwordstringtruewrite-only密码
confirm_passwordstringfalsenone确认密码
remarkstringfalsenone备注
console_statestringtruenone控制台启用状态
open_api_statestringtruenoneopen_api启用状态
mfa_statestringtruenonemfa启用状态
set_password_first_loginstringtruenone是否首次登录时重置密码
set_password_next_loginstringfalsenone是否下次登录重置密码
set_password_at_loginstringfalsenone是否首次登录时重置密码
akAkfalsenoneAk
set_password_timestring(date-time)falseread-only修改密码时间
last_login_timestring(date-time)falseread-only上一次登录时间
create_timestring(date-time)falseread-only用户创建时间
update_timestring(date-time)falseread-only用户更新时间
join_timestring(date-time)falseread-only用户加入某个组的时间
password_updator_idstringfalsenone上一次密码修改人id
password_updator_usernamestringfalsenone上一次密码修改人用户名
invalid_timestring(date-time)falseread-only失效时间
message_phonestringfalseread-only消息通知手机号
message_emailstringfalseread-only消息通知邮箱
message_phone_verifiedbooleanfalseread-only消息通知手机号验证状态
message_email_verifiedbooleanfalseread-only消息通知邮箱验证状态