UpdateUser

Last Updated: Aug 26, 2016

Interface description

 Updates basic user information.

Request parameters

Action

  • Type: String
  • Required: Yes
  • Description: Operation interface, required. The parameter value is “UpdateUser”.

UserName

  • Type: String
  • Required: Yes
  • Description: User name.
  • Format: ^[a-zA-Z0-9\.@\-_]+$

NewUserName

  • Type: String
  • Required: No
  • Description: New user name.
  • Format: ^[a-zA-Z0-9\.@\-_]+$

NewDisplayName

  • Type: String
  • Required: No
  • Description: New display name.

NewMobilePhone

  • Type: String
  • Required: No
  • Description: An RAM user’s new mobile number.
  • Format: International area code-number such as 86-18600008888

NewEmail

  • Type: String
  • Required: No
  • Description: An RAM user’s new email address.

NewComments

  • Type: String
  • Required: No
  • Description: New remark information. It consists of a maximum of 128 characters.

Return parameters

User

  • Type: User Type
  • Description: User information.

Required permissions

Action

ram:UpdateUser

Resource

acs:ram:*:${AccountId}:user/${UserName}

Error messages

InvalidParameter.UserName.InvalidChars
  • HTTP Status:400
  • Error Message:The parameter - “UserName” contains invalid chars.
InvalidParameter.UserName.Length
  • HTTP Status:400
  • Error Message:The parameter - “UserName” beyond the length limit.
InvalidParameter.NewUserName.InvalidChars
  • HTTP Status:400
  • Error Message:The parameter - “NewUserName” contains invalid chars.
InvalidParameter.NewUserName.Length
  • HTTP Status:400
  • Error Message:The parameter - “NewUserName” beyond the length limit.
InvalidParameter.NewDisplayName.InvalidChars
  • HTTP Status:400
  • Error Message:The parameter - “NewDisplayName” contains invalid chars.
InvalidParameter.NewDisplayName.Length
  • HTTP Status:400
  • Error Message:The parameter - “NewDisplayName” beyond the length limit.
InvalidParameter.NewComments.Length
  • HTTP Status:400
  • Error Message:The parameter - “NewComments” beyond the length limit.
InvalidParameter.NewMobilePhone.Format
  • HTTP Status:400
  • Error Message:The format of the parameter - “NewMobilePhone” is incorrect.
InvalidParameter.NewEmail.Format
  • HTTP Status:400
  • Error Message:The format of the parameter - “NewEmail” is incorrect.
EntityNotExist.User
  • HTTP Status:404
  • Error Message:The user does not exist.
EntityAlreadyExists.User
  • HTTP Status:409
  • Error Message:The user does already EXIST.

Operation examples

Request example

  1. https://ram.aliyuncs.com/?Action=UpdateUser
  2. &UserName=zhangqiang
  3. &NewUserName=xiaoqiang
  4. &NewMobilePhone=86-18600008888
  5. &NewEmail=zhangqiang@example.com
  6. &<Public request parameters>

Return example

XML format

  1. <CreateUserResponse>
  2. <RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
  3. <User>
  4. <UserId>1227489245380721</UserId>
  5. <UserName>xiaoqiang</UserName>
  6. <DisplayName>zhangqiang</DisplayName>
  7. <MobilePhone>86-18600008888</MobilePhone>
  8. <Email>zhangqiang@example.com</Email>
  9. <Comments>This is a cloud computing engineer.</Comments>
  10. <CreateDate>2015-01-23T12:33:18Z</CreateDate>
  11. <UpdateDate>2015-02-11T03:15:21Z</UpdateDate>
  12. </User>
  13. </CreateUserResponse>

JSON format

  1. {
  2. "RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368",
  3. "User": {
  4. "UserId": "1227489245380721",
  5. "UserName": "xiaoqiang",
  6. "DisplayName": "zhangqiang",
  7. "MobilePhone": "86-18600008888",
  8. "Email": "zhangqiang@example.com",
  9. "Comments": "This is a cloud computing engineer".
  10. "CreateDate": "2015-01-23T12:33:18Z",
  11. "UpdateDate": "2015-02-11T03:15:21Z"
  12. }
  13. }
Thank you! We've received your feedback.