AddUserToGroup

Last Updated: Aug 26, 2016

Interface description

 Adds a user to a specified user group.

Request parameters

Action

  • Type: String
  • Required: Yes
  • Description: Operation name. Value: AddUserToGroup

UserName

  • Type: String
  • Required: Yes
  • Description: User name.

GroupName

  • Type: String
  • Required: Yes
  • Description: Group name.

Return parameters

  Only public parameters are returned. For details, see Public return parameters.

Required permissions

Action

ram:AddUserToGroup

Resource

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

acs:ram:*:${AccountId}:group/${GroupName}

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.GroupName.InvalidChars
  • HTTP Status:400
  • Error Message:The parameter - “GroupName” contains invalid chars.
InvalidParameter.GroupName.Length
  • HTTP Status:400
  • Error Message:The parameter - “GroupName” beyond the length limit.
EntityNotExist.User
  • HTTP Status:404
  • Error Message:The user does not exist.
EntityNotExist.Group
  • HTTP Status:404
  • Error Message:The group does not exist.
EntityAlreadyExists.User.Group
  • HTTP Status:409
  • Error Message:The user has already joined the group.
LimitExceeded.User.Group
  • HTTP Status:409
  • Error Message:The count of groups the target user joined beyond the current limits.

Operation examples

Request example

  1. https://ram.aliyuncs.com/?Action=AddUserToGroup
  2. &UserName=zhangqiang
  3. &GroupName=Dev-Team
  4. &<Public request parameters>

Return example

XML format

  1. <AddUserToGroupResponse>
  2. <RequestId>1B968853-B423-63A6-FE1F-45E81BC2AD61</RequestId>
  3. </AddUserToGroupResponse>

JSON format

  1. {
  2. "RequestId": "1B968853-B423-63A6-FE1F-45E81BC2AD61"
  3. }
Thank you! We've received your feedback.