Update User Partial Attributes
Request Description
Request Headers
| Parameter Name | Chinese Name | Required | Type | Description |
|---|---|---|---|---|
| Authorization | Authorization | Yes | String | Format: Bearer {access_token} |
| Content-Type | Content Type | Yes | String | Fixed value: application/json; charset=utf-8 |
Request Example
Example of updating the user's name
{
"name": "张三"
}Example of updating username, name, mobile, email, extended attributes, etc.
{
"user_name":"zhangsan",
"name":"张三",
"mobile":"15200000000",
"email":"15200000000@qq.com",
"head_img": "data:image/jpeg;base64,......."
}Update the user's identity information based on the requested user ID parameter, supporting partial user attribute updates. For example, when the request parameter only contains the user's name, the system only updates the user's name, and other user attributes remain unchanged.
Request Parameters
| Parameter Name | Chinese Name | Required | Type | Description |
|---|---|---|---|---|
| user_name | Username | No | String | Username, the unique identifier of the user within the enterprise. Can be specified in the request parameters; if not passed, the system will generate it automatically |
| name | Name | No | String | |
| mobile | Mobile Number | No | String | |
| No | String | |||
| attr_gender | Gender | No | String | Optional values: "unknow": confidential "male": male "female": female |
| attr_birthday | Birthday | No | String | Format: yyyy-mm-dd |
| attr_nick_name | Nickname | No | String | |
| mailing_address | Mailing Address | No | String | |
| zip_code | Zip Code | No | String | |
| first_name | First Name | No | String | |
| middle_name | Middle Name | No | String | |
| last_name | Last Name | No | String | |
| industry | Industry | No | String | |
| extension | Extended Attributes | No | JSONObject | Extended attributes; extended attributes need to be defined in the enterprise |
| head_img | User Avatar | No | String | User avatar, supports base64-encoded image strings and URLs starting with http or https |
Note: The enterprise can modify whether system-built-in attributes are required and their display names in "Enterprise Center - User Attribute Definition" (system attributes cannot be deleted), and can also extend user attributes according to business needs. Interface request parameters are processed based on the attributes defined in the "User Attribute Definition" module.
Response Example
Success Example
HTTP/1.1 200 OK
{
"user_id": "20201028102749564-9082-DC8CD2722"
}Error Example
HTTP/1.1 400 Bad Request
{
"error_msg": "User not found",
"error_code": "IDAAS.TENANT.USER.0001"
}Response Parameters
| Parameter Name | Chinese Name | Type | Description |
|---|---|---|---|
| user_id | User ID | String |
Error Codes
| Status Code | Error Code | Chinese Error Message | English Error Message | Resolution |
|---|---|---|---|---|
| 400 | IDAAS.TENANT.USER.0001 | 用户未找到 | User not found | Please check whether the user exists |
| 400 | IDAAS.TENANT.USER.0002 | 用户名不能为空 | Username cannot be empty | Please check whether the username field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0003 | 姓名不能为空 | Name cannot be empty | Please check whether the name field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0004 | 手机号不能为空 | Mobile number cannot be empty | Please check whether the mobile number field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0005 | 邮箱不能为空 | E-mail cannot be empty | Please check whether the email field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0007 | 性别不能为空 | Gender cannot be empty | Please check whether the gender field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0008 | 生日不能为空 | Birthday cannot be empty | Please check whether the birthday field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0009 | 昵称不能为空 | Nick name cannot be empty | Please check whether the nickname field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0010 | 邮寄地址不能为空 | Mailing address cannot be empty | Please check whether the mailing address field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0011 | 邮政编码不能为空 | Zip code cannot be empty | Please check whether the zip code field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0012 | 名字不能为空 | First name cannot be empty | Please check whether the first name field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0013 | 中间名不能为空 | Middle name cannot be empty | Please check whether the middle name field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0014 | 姓氏不能为空 | Last name cannot be empty | Please check whether the last name field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0015 | 所属行业不能为空 | Industry cannot be empty | Please check whether the industry field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0017 | 扩展属性{0}不能为空 | Extended property {0} cannot be empty | Please check whether the external ID field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0018 | 用户名不符合校验规则 | The username does not meet the verification rules | Please check whether the username field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.USER.0019 | 姓名不符合校验规则 | The name does not meet the verification rules | Please check whether the name field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.USER.0020 | 手机号不符合校验规则 | The mobile number does not meet the verification rules | Please check whether the mobile number field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.USER.0021 | 邮箱不符合校验规则 | The e-mail does not meet the verification rules | Please check whether the email field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.USER.0023 | 性别不符合校验规则 | The gender does not meet the verification rules | Please check whether the gender field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.USER.0024 | 生日不符合校验规则 | The birthday does not meet the verification rules | Please check whether the birthday field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.USER.0025 | 昵称不符合校验规则 | The nickname does not meet the verification rules | Please check whether the nickname field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.USER.0026 | 邮寄地址不符合校验规则 | The mailing address does not meet the verification rules | Please check whether the mailing address field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.USER.0027 | 邮政编码不符合校验规则 | The zip code does not meet the verification rules | Please check whether the zip code field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.USER.0028 | 名字不符合校验规则 | The first name does not meet the verification rules | Please check whether the first name field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.USER.0029 | 中间名不符合校验规则 | The middle name does not meet the verification rules | Please check whether the middle name field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.USER.0030 | 姓氏不符合校验规则 | The last name does not meet the verification rules | Please check whether the last name field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.USER.0031 | 所属行业不符合校验规则 | The industry does not meet the verification rules | Please check whether the industry field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.USER.0033 | 扩展属性{0}不符合校验规则 | The extended attribute {0} does not meet the verification rules | Please check whether the external ID field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.MOBILE.0002 | 未经认证的手机号 | An unauthenticated cell mobile number | Please check whether the "Enterprise Center - Enterprise Configuration - International Dialing Code Configuration" meets the configuration rules |
| 400 | IDAAS.TENANT.USER.0034 | 用户名已存在 | Username already exists | Please check whether the user exists |
| 400 | IDAAS.TENANT.USER.0035 | 手机号已存在 | Mobile number already exists | Delete the mobile number and re-add it, or replace it with a mobile number that has not been added |
| 400 | IDAAS.TENANT.USER.0036 | 邮箱已存在 | E-mail already exists | Delete the email and re-add it, or replace it with an email that has not been added |
| 400 | IDAAS.TENANT.USER.0037 | 扩展属性{0}已存在 | Extended property {0} already exists | Delete the extended property {0} and re-add it, or replace it with an extended property {0} that has not been added |