ListGroupsForUser

Last Updated: Aug 26, 2016

Interface description

 Lists groups a specified user has joined.

Request parameters

Action

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

UserName

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

Return parameters

Groups
  • Type: Group Type Array
  • Description: Group information set.

Required permissions

Action

ram:ListGroupsForUser

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.
EntityNotExist.User
  • HTTP Status:404
  • Error Message:The user does not exist.

Operation examples

Request example

  1. https://ram.aliyuncs.com/?Action=ListGroupsForUser
  2. &UserName=zhangqiang
  3. &<Public request parameters>

Return example

XML format

  1. <ListGroupsForUserResponse>
  2. <RequestId>0945BF6F-54A4-C384-C89C-C500DCEE367C</RequestId>
  3. <Groups>
  4. <Group>
  5. <GroupName>Dev-Team</GroupName>
  6. <Comments>Development team</Comments>
  7. <JoinDate>2015-01-23T12:33:18Z</JoinDate>
  8. </Group>
  9. <Group>
  10. <GroupName>QA-Team</GroupName>
  11. <Comments>Test team</Comments>
  12. <JoinDate>2015-02-18T17:22:08Z</JoinDate>
  13. </Group>
  14. </Groups>
  15. </ListGroupsForUserResponse>

JSON format

  1. {
  2. "RequestId": "0945BF6F-54A4-C384-C89C-C500DCEE367C",
  3. "Groups": {
  4. "Group": [
  5. {
  6. "GroupName": "Dev-Team",
  7. "Comments": "Development team",
  8. "JoinDate" : "2015-01-23T12:33:18Z"
  9. },
  10. {
  11. "GroupName": "QA-Team",
  12. "Comments": "Test team",
  13. "JoinDate" : "2015-02-18T17:22:08Z"
  14. }
  15. ]
  16. }
  17. }
Thank you! We've received your feedback.