Namespace: microsoft.graph
Retrieve the list of tabs in the specified chat.
Note: If the chat is associated with an onlineMeeting instance, then, effectively, the tabs pinned in the meeting will be listed.
This API is available in the following national cloud deployments.
| Global service |
US Government L4 |
US Government L5 (DOD) |
China operated by 21Vianet |
| ✅ |
✅ |
✅ |
✅ |
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.
| Permission type |
Least privileged permissions |
Higher privileged permissions |
| Delegated (work or school account) |
TeamsTab.Read.All |
TeamsTab.ReadWrite.All, TeamsTab.ReadWriteForChat, TeamsTab.ReadWriteSelfForChat |
| Delegated (personal Microsoft account) |
Not supported. |
Not supported. |
| Application |
TeamsTab.Read.All |
TeamsTab.ReadWrite.All, TeamsTab.ReadWriteForChat.All, TeamsTab.ReadWriteSelfForChat.All |
HTTP request
GET /chats/{chat-id}/tabs
Optional query parameters
This method supports the $filter, $select, and $expand OData query parameters to help customize the response.
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 tabs objects in the response body.
Examples
Example 1: List all the tabs in the chat along with associated Teams app
Request
The following example shows a request.
GET https://graph.microsoft.com/v1.0/chats/19:d65713bc498c4a428c71ef9353e6ce20@thread.v2/tabs?$expand=teamsApp
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Chats["{chat-id}"].Tabs.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Expand = new string []{ "teamsApp" };
});
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphchats "github.com/microsoftgraph/msgraph-sdk-go/chats"
//other-imports
)
requestParameters := &graphchats.ItemTabsRequestBuilderGetQueryParameters{
Expand: [] string {"teamsApp"},
}
configuration := &graphchats.ItemTabsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
tabs, err := graphClient.Chats().ByChatId("chat-id").Tabs().Get(context.Background(), configuration)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
TeamsTabCollectionResponse result = graphClient.chats().byChatId("{chat-id}").tabs().get(requestConfiguration -> {
requestConfiguration.queryParameters.expand = new String []{"teamsApp"};
});
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
const options = {
authProvider,
};
const client = Client.init(options);
let tabs = await client.api('/chats/19:d65713bc498c4a428c71ef9353e6ce20@thread.v2/tabs')
.expand('teamsApp')
.get();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Chats\Item\Tabs\TabsRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new TabsRequestBuilderGetRequestConfiguration();
$queryParameters = TabsRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->expand = ["teamsApp"];
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->chats()->byChatId('chat-id')->tabs()->get($requestConfiguration)->wait();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.chats.item.tabs.tabs_request_builder import TabsRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
query_params = TabsRequestBuilder.TabsRequestBuilderGetQueryParameters(
expand = ["teamsApp"],
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.chats.by_chat_id('chat-id').tabs.get(request_configuration = request_configuration)
For details about how to add the SDK to your project and create an authProvider instance, see the 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": [
{
"id": "794f0e4e-4d10-4bb5-9079-3a465a629eff",
"displayName": "My Contoso Tab - updated",
"sortOrderIndex": "20",
"webUrl": "https://teams.microsoft.com/l/entity/com.microsoft.teamspace.tab.web/_djb2_msteams_prefix_193fe248-24e6-478f-a66c-ede9ce6dd547?context=%7b%0d%0a++%22context%22%3a+%22chat%22%2c%0d%0a++%22chatId%22%3a+%2219%3ad65713bc498c4a428c71ef9353e6ce20%40thread.v2%22%2c%0d%0a++%22subEntityId%22%3a+null%0d%0a%7d&tenantId=139d16b4-7223-43ad-b9a8-674ba63c7924",
"configuration": {
"entityId": "2DCA2E6C7A10415CAF6B8AB6661B3154",
"contentUrl": "https://www.contoso.com/Orders/2DCA2E6C7A10415CAF6B8AB6661B3154/tabView",
"websiteUrl": "https://www.contoso.com/Orders/2DCA2E6C7A10415CAF6B8AB6661B3154",
"removeUrl": "https://www.contoso.com/Orders/2DCA2E6C7A10415CAF6B8AB6661B3154/uninstallTab"
},
"teamsApp": {
"id": "06805b9e-77e3-4b93-ac81-525eb87513b8",
"displayName": "Contoso",
"distributionMethod": "store"
}
},
{
"id": "1f7b40e5-ecdf-40cb-b02e-e785cf71c0e9",
"displayName": "Website2",
"teamsAppId": null,
"sortOrderIndex": "10000100",
"messageId": "1607411851584",
"webUrl": "https://teams.microsoft.com/l/entity/com.microsoft.teamspace.tab.web/_djb2_msteams_prefix_44125e1d-04b1-421a-9f45-19d913494b3e?context=%7b%0d%0a++%22context%22%3a+%22chat%22%2c%0d%0a++%22chatId%22%3a+%2219%3ad65713bc498c4a428c71ef9353e6ce20%40thread.v2%22%2c%0d%0a++%22subEntityId%22%3a+null%0d%0a%7d&tenantId=139d16b4-7223-43ad-b9a8-674ba63c7924",
"configuration": {
"entityId": null,
"contentUrl": "https://www.bing.com",
"removeUrl": null,
"websiteUrl": "https://www.bing.com",
"dateAdded": "2020-12-08T07:17:29.748Z"
},
"teamsApp": {
"id": "com.microsoft.teamspace.tab.web",
"externalId": null,
"displayName": "Website",
"distributionMethod": "store"
}
},
{
"id": "b92dd123-1624-425c-a808-2f11e03534a5",
"displayName": "Some random board",
"sortOrderIndex": "10000100100",
"messageId": "1607412162267",
"webUrl": "https://teams.microsoft.com/l/entity/49e6f432-d79c-49e8-94f7-89b94f3672fd/_djb2_msteams_prefix_2919ec48-12d8-4533-b849-56c4d207734b?context=%7b%0d%0a++%22context%22%3a+%22chat%22%2c%0d%0a++%22chatId%22%3a+%2219%3ad65713bc498c4a428c71ef9353e6ce20%40thread.v2%22%2c%0d%0a++%22subEntityId%22%3a+null%0d%0a%7d&tenantId=139d16b4-7223-43ad-b9a8-674ba63c7924",
"configuration": {
"entityId": "5fcf29c17a3a3142160b8694",
"contentUrl": "https://trello.com/integrations/teams/tab-content?iframeSource=msteams&contentUrl=https%3A%2F%2Ftrello.com%2Fb%2FkS2FslqK%2Fsome-random-board",
"removeUrl": "https://trello.com/integrations/teams/tab-delete?iframeSource=msteams",
"websiteUrl": "https://trello.com/b/kS2FslqK/some-random-board",
"dateAdded": "2020-12-08T07:22:40.001Z"
},
"teamsApp": {
"id": "49e6f432-d79c-49e8-94f7-89b94f3672fd",
"externalId": null,
"displayName": "Trello",
"distributionMethod": "store"
}
}
]
}
Example 2: List all the tabs belonging to a specific app in a chat
Request
The following example shows a request.
GET https://graph.microsoft.com/v1.0/chats/19:d65713bc498c4a428c71ef9353e6ce20@thread.v2/tabs?$expand=teamsApp&$filter=teamsApp/id eq 'com.microsoft.teamspace.tab.web'
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Chats["{chat-id}"].Tabs.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Expand = new string []{ "teamsApp" };
requestConfiguration.QueryParameters.Filter = "teamsApp/id eq 'com.microsoft.teamspace.tab.web'";
});
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphchats "github.com/microsoftgraph/msgraph-sdk-go/chats"
//other-imports
)
requestFilter := "teamsApp/id eq 'com.microsoft.teamspace.tab.web'"
requestParameters := &graphchats.ItemTabsRequestBuilderGetQueryParameters{
Expand: [] string {"teamsApp"},
Filter: &requestFilter,
}
configuration := &graphchats.ItemTabsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
tabs, err := graphClient.Chats().ByChatId("chat-id").Tabs().Get(context.Background(), configuration)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
TeamsTabCollectionResponse result = graphClient.chats().byChatId("{chat-id}").tabs().get(requestConfiguration -> {
requestConfiguration.queryParameters.expand = new String []{"teamsApp"};
requestConfiguration.queryParameters.filter = "teamsApp/id eq 'com.microsoft.teamspace.tab.web'";
});
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
const options = {
authProvider,
};
const client = Client.init(options);
let tabs = await client.api('/chats/19:d65713bc498c4a428c71ef9353e6ce20@thread.v2/tabs')
.filter('teamsApp/id eq \'com.microsoft.teamspace.tab.web\'')
.expand('teamsApp')
.get();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Chats\Item\Tabs\TabsRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new TabsRequestBuilderGetRequestConfiguration();
$queryParameters = TabsRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->expand = ["teamsApp"];
$queryParameters->filter = "teamsApp/id eq 'com.microsoft.teamspace.tab.web'";
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->chats()->byChatId('chat-id')->tabs()->get($requestConfiguration)->wait();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Import-Module Microsoft.Graph.Teams
Get-MgChatTab -ChatId $chatId -ExpandProperty "teamsApp" -Filter "teamsApp/id eq 'com.microsoft.teamspace.tab.web'"
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.chats.item.tabs.tabs_request_builder import TabsRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
query_params = TabsRequestBuilder.TabsRequestBuilderGetQueryParameters(
expand = ["teamsApp"],
filter = "teamsApp/id eq 'com.microsoft.teamspace.tab.web'",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.chats.by_chat_id('chat-id').tabs.get(request_configuration = request_configuration)
For details about how to add the SDK to your project and create an authProvider instance, see the 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
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#chats('19%3Ad65713bc498c4a428c71ef9353e6ce20%40thread.v2')/tabs(teamsApp())",
"@odata.count": 1,
"value": [
{
"id": "1f7b40e5-ecdf-40cb-b02e-e785cf71c0e9",
"displayName": "Website2",
"teamsAppId": null,
"sortOrderIndex": "10000100",
"messageId": "1607411851584",
"webUrl": "https://teams.microsoft.com/l/entity/com.microsoft.teamspace.tab.web/_djb2_msteams_prefix_44125e1d-04b1-421a-9f45-19d913494b3e?context=%7b%0d%0a++%22context%22%3a+%22chat%22%2c%0d%0a++%22chatId%22%3a+%2219%3ad65713bc498c4a428c71ef9353e6ce20%40thread.v2%22%2c%0d%0a++%22subEntityId%22%3a+null%0d%0a%7d&tenantId=139d16b4-7223-43ad-b9a8-674ba63c7924",
"configuration": {
"entityId": null,
"contentUrl": "https://www.bing.com",
"removeUrl": null,
"websiteUrl": "https://www.bing.com",
"dateAdded": "2020-12-08T07:17:29.748Z"
},
"teamsApp": {
"id": "com.microsoft.teamspace.tab.web",
"externalId": null,
"displayName": "Website",
"distributionMethod": "store"
}
}
]
}
Related content