Queries the groups to which a user is added.
Usage notes
This topic provides an example on how to query the groups to which the user u-00q8wbq42wiltcrk****
is added. The returned result shows that the user is added to both the TestGroup
and the group1
groups.
Limits
You can call this operation up to 100 times per second per account. This operation is globally limited to 100 times per second across all accounts. If the number of the calls per second exceeds a limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limits when you call this operation.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ListJoinedGroupsForUser |
The operation that you want to perform. Set the value to ListJoinedGroupsForUser. |
UserId | String | Yes | u-00q8wbq42wiltcrk**** |
The ID of the user. |
DirectoryId | String | Yes | d-00fc2p61**** |
The ID of the directory. |
NextToken | String | No | K1c3o9K7pFxoTtxH1Nm7MMLb7zrDGvftYBQBPDVv7AD3a8yhRb3Mk8L9ivmN6bFSjfkZNTAg3h4**** |
The token to return for the next page. If this is your first time to call this operation,
you do not need to specify When you call this operation for the first time, if the total number of entries to
return exceeds the value of |
MaxResults | Integer | No | 10 |
The number of entries to return on each page. Valid values: 1 to 100. Default value: 10. |
For more information about common request parameters, see Common parameters.
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
NextToken | String | K1c3o9K7pFxoTtxH1Nm7MMLb7zrDGvftYBQBPDVv7AD3a8yhRb3Mk8L9ivmN6bFSjfkZNTAg3h4**** |
The token that is returned for the next page. Note This parameter is returned only when the value of
IsTruncated is true .
|
RequestId | String | E9BBB45F-7877-5DE9-96A5-20E6CFA48929 |
The ID of the request. |
TotalCounts | Integer | 2 |
The total number of entries returned. |
MaxResults | Integer | 10 |
The number of entries returned per page. |
IsTruncated | Boolean | false |
Indicates whether the queried entries are truncated. Valid values:
|
JoinedGroups | Array of JoinedGroup |
The groups to which the user is added. |
|
GroupName | String | TestGroup |
The name of the group. |
Description | String | This is a group. |
The description of the group. |
UserId | String | u-00q8wbq42wiltcrk**** |
The ID of the user. |
ProvisionType | String | Manual |
The type of the group. Valid values:
|
JoinTime | String | 2021-11-01T06:58:18Z |
The time when the user was added to the user group. |
GroupId | String | g-00jqzghi2n3o5hkh**** |
The ID of the group. |
Examples
Sample requests
https://[Endpoint]/?Action=ListJoinedGroupsForUser
&UserId=u-00q8wbq42wiltcrk****
&DirectoryId=d-00fc2p61****
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<ListJoinedGroupsForUserResponse>
<RequestId>E9BBB45F-7877-5DE9-96A5-20E6CFA48929</RequestId>
<TotalCounts>2</TotalCounts>
<MaxResults>10</MaxResults>
<IsTruncated>false</IsTruncated>
<JoinedGroups>
<JoinedGroup>
<GroupName>TestGroup</GroupName>
<Description>This is a group.</Description>
<UserId>u-00q8wbq42wiltcrk****</UserId>
<ProvisionType>Manual</ProvisionType>
<JoinTime>2021-11-01T06:58:18Z</JoinTime>
<GroupId>g-00jqzghi2n3o5hkh****</GroupId>
</JoinedGroup>
<JoinedGroup>
<GroupName>group1</GroupName>
<Description></Description>
<UserId>u-00q8wbq42wiltcrk****</UserId>
<ProvisionType>Synchronized</ProvisionType>
<JoinTime>2021-11-01T07:16:44Z</JoinTime>
<GroupId>g-00dd217ozcicxqz0****</GroupId>
</JoinedGroup>
</JoinedGroups>
</ListJoinedGroupsForUserResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "E9BBB45F-7877-5DE9-96A5-20E6CFA48929",
"TotalCounts" : 2,
"MaxResults" : 10,
"IsTruncated" : false,
"JoinedGroups" : [ {
"GroupName" : "TestGroup",
"Description" : "This is a group.",
"UserId" : "u-00q8wbq42wiltcrk****",
"ProvisionType" : "Manual",
"JoinTime" : "2021-11-01T06:58:18Z",
"GroupId" : "g-00jqzghi2n3o5hkh****"
}, {
"GroupName" : "group1",
"Description" : "",
"UserId" : "u-00q8wbq42wiltcrk****",
"ProvisionType" : "Synchronized",
"JoinTime" : "2021-11-01T07:16:44Z",
"GroupId" : "g-00dd217ozcicxqz0****"
} ]
}
Error codes
For a list of error codes, visit the API Error Center.