UpdateUser - 更新用户信息
更新用户信息。
服务接入点与授权信息
请求语法
PUT https://{domain}/oapi/v1/platform/users/{idOrUsername}
请求头
参数 |
类型 |
是否必填 |
描述 |
示例值 |
x-yunxiao-token |
string |
是 |
个人访问令牌。 |
pt-0fh3****0fbG_35af****0484 |
请求参数
参数 |
类型 |
位置 |
是否必填 |
描述 |
示例值 |
idOrUsername |
string |
path |
是 |
用户 ID 或登录账号。 |
|
- |
object |
body |
否 |
|
|
email |
string |
body |
否 |
邮箱。 |
test**@example.com |
name |
string |
body |
否 |
显示用户名。 |
示例用户名 |
nickName |
string |
body |
否 |
昵称。 |
示例昵称 |
operatorId |
string |
body |
否 |
使用非个人访问令牌如应用访问令牌调用时,需指定操作人。 |
99d1**6124 |
password |
string |
body |
否 |
密码。 |
Yun**@0123 |
staffId |
string |
body |
否 |
工号。 |
123** |
sysDeptIds |
array[string] |
body |
否 |
为空表示不更新部门信息。 |
[99d1**6124] |
请求示例
curl -X 'PUT' \
'https://test.rdc.aliyuncs.com/oapi/v1/platform/users/{idOrUsername}' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"email": "test****@example.com",
"name": "示例用户名",
"nickName": "示例昵称",
"operatorId": "99d1****6124",
"password": "Yun****@0123",
"staffId": "123****",
"sysDeptIds": [99d1****6124]
}'
返回参数
参数 |
类型 |
描述 |
示例值 |
- |
object |
|
|
email |
string |
邮箱。 |
test**@example.com |
id |
string |
用户 ID。 |
99d1**6124 |
lastOrganization |
string |
上次登录组织。 |
99d1**6124 |
name |
string |
显示名称。 |
示例用户名 |
nickName |
string |
昵称。 |
示例昵称 |
staffId |
string |
工号。 |
123** |
sysDeptIds |
array[string] |
所属部门。 |
[99d1**6124] |
username |
string |
登录账号名。 |
demo**username |
返回示例
{
"email": "test****@example.com",
"id": "99d1****6124",
"lastOrganization": "99d1****6124",
"name": "示例用户名",
"nickName": "示例昵称",
"staffId": "123****",
"sysDeptIds": [99d1****6124],
"username": "demo**username"
}
错误码
访问错误码中心查看 API 相关错误码。