Modifying a User
Function
This API is used to modify a user.
Constraints
null
URI
PUT /api/v2/tenant/users/{user_id}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
user_id |
Yes |
String |
User ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
Content-Type |
Yes |
String |
Set this field to "application/json;charset=utf8". |
Authorization |
Yes |
String |
Authentication credential. The value is "Bearer {access_token}". access_token is obtained by calling the API for obtaining an access credential. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
user_name |
No |
String |
Username, which is a unique identifier in an enterprise. |
mobile |
No |
String |
Mobile number, which is unique in an enterprise. |
org_code |
No |
String |
Organization code. |
name |
No |
String |
Real name. |
|
No |
String |
Email address. |
employee_id |
No |
String |
Employee ID. |
first_name |
No |
String |
Name. |
middle_name |
No |
String |
Middle name. |
last_name |
No |
String |
Last name. |
pwd_must_modify |
No |
Boolean |
Whether the password must be changed upon the first login. |
attr_gender |
No |
String |
Gender. |
attr_birthday |
No |
String |
Date of birth. Format: yyyy-mm-dd. |
attr_nick_name |
No |
String |
Alias. |
attr_identity_type |
No |
String |
Certificate type. |
attr_identity_number |
No |
String |
Certificate number. |
attr_area |
No |
String |
Country or region code. |
attr_city |
No |
String |
City. |
attr_manager_id |
No |
String |
Immediate superior. |
attr_user_type |
No |
String |
Personnel type. |
attr_hire_date |
No |
String |
Onboarding date. Format: yyyy-MM-dd. |
attr_work_place |
No |
String |
Work location. |
user_org_relation_list |
No |
UserOrgRelationListOption object |
|
extension |
No |
Object |
Custom extended attribute. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
user_id |
String |
User ID. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error details. |
Example Requests
Modify the username to zhangsan, mobile number to 12345678901, and email address to zhangsan@example.com.
PUT https://{domain_name}/api/v2/tenant/users/{user_id} Authorization: Bearer 334963fc-1e4a-473b-9096-52a929140... { "user_name": "zhangsan", "org_code": "10000", "name": "zhangsan", "mobile": "12345678901", "email": "zhangsan@example.com", "employee_id": "123456789", "pwd_must_modify": false, "first_name": "F", "middle_name": "M", "last_name": "L", "attr_gender": "male", "attr_birthday": "1990-02-01", "attr_nick_name": "zhangsan", "attr_identity_type": "id_card", "attr_identity_number": "123456789", "attr_area": "CN", "attr_city": "xxx", "attr_manager_id": "123456789", "attr_user_type": "regular", "attr_hire_date": "2021-04-01", "attr_work_place": "xxx", "user_org_relation_list": [ { "orgCode": "10000", "relationType": 1 }, { "orgCode": "TestOrg1", "relationType": 0 }, { "orgCode": "TestOrg2", "relationType": 0 } ], "extension": { "age": "18" } }
Example Responses
Status code: 200
Request successful.
{ "user_id" : "20210621095935811-5E16-6B3060..." }
Status Codes
Status Code |
Description |
---|---|
200 |
Request successful. |
400 |
Invalid parameter. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot