| title | List associatedTeamInfo |
|---|---|
| description | Get the list of teams in Microsoft Teams that a user is associated with. |
| author | devjha-ms |
| ms.localizationpriority | high |
| ms.subservice | teams |
| doc_type | apiPageType |
| ms.date | 07/25/2024 |
Namespace: microsoft.graph
Get the list of teams in Microsoft Teams that a user is associated with. Currently, a user can be associated with a team in two different ways:
- A user can be a direct member of a team.
- A user can be a member of a shared channel that is hosted inside a team.
[!INCLUDE national-cloud-support]
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
[!INCLUDE permissions-table]
Note: Currently, with user delegated permissions, this operation only works for the
meuser. With application permissions, it works for all users by specifying the specific user ID (mealias is not supported with application permissions).
GET /users/{user-id}/teamwork/associatedTeamsThis method does not currently support the OData query parameters to customize the response.
| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Don't supply a request body for this method.
If successful, this method returns a 200 OK response code and a collection of associatedTeamInfo objects in the response body.
Note: This API also returns the host team of the shared channel that the user is a direct member of.
The following example shows a request.
GET https://graph.microsoft.com/v1.0/me/teamwork/associatedTeams
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": [
{
"@odata.type": "#microsoft.graph.associatedTeamInfo",
"id": "b695c5a5-c5a5-b695-a5c5-95b6a5c595b6",
"tenantId": "172b0cce-e65d-7hd4-9a49-91d9f2e8493a",
"displayName": "Contoso Team"
},
{
"@odata.type": "#microsoft.graph.associatedTeamInfo",
"id": "b695c5a5-8934-b695-a5c5-95b6a5c595b6",
"tenantId": "172b0cce-8961-7hd4-9a49-91d9f2e8493a",
"displayName": "Fabrikam Team"
}
]
}