Skip to content

Latest commit

 

History

History
144 lines (108 loc) · 5.1 KB

File metadata and controls

144 lines (108 loc) · 5.1 KB
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

List associatedTeamInfo

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]

Permissions

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 me user. With application permissions, it works for all users by specifying the specific user ID (me alias is not supported with application permissions).

HTTP request

GET /users/{user-id}/teamwork/associatedTeams

Optional query parameters

This method does not currently support the OData query parameters to customize the response.

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.

Request body

Don't supply a request body for this method.

Response

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.

Examples

Request

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]


Response

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"
    }
  ]
}

Related content