Si la conversation est associée à un instance onlineMeeting, l’onglet est effectivement ajouté à la réunion.
Si le manifeste d’application pour un appId donné contient un onglet statique qui correspond à l’étendue actuelle (chat/groupChat), l’onglet statique est épinglé par défaut.
Dans le corps de la demande, incluez une représentation JSON d’un élément teamsTab.
Remarque
Lorsque vous épinglez un onglet statique, Teams prend le displayName et la configuration à partir du manifeste de l’application. Si ces propriétés sont spécifiées dans le corps de la demande, cette API retourne un 400 Bad Request code de réponse.
Réponse
Si elle réussit, cette méthode renvoie un 201 Created code de réponse et un instance de la ressource teamsTab dans le corps.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new TeamsTab
{
DisplayName = "My Contoso Tab",
Configuration = new TeamsTabConfiguration
{
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",
},
AdditionalData = new Dictionary<string, object>
{
{
"teamsApp@odata.bind" , "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/06805b9e-77e3-4b93-ac81-525eb87513b8"
},
},
};
// To initialize your graphClient, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Chats["{chat-id}"].Tabs.PostAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
TeamsTab teamsTab = new TeamsTab();
teamsTab.setDisplayName("My Contoso Tab");
TeamsTabConfiguration configuration = new TeamsTabConfiguration();
configuration.setEntityId("2DCA2E6C7A10415CAF6B8AB6661B3154");
configuration.setContentUrl("https://www.contoso.com/Orders/2DCA2E6C7A10415CAF6B8AB6661B3154/tabView");
configuration.setWebsiteUrl("https://www.contoso.com/Orders/2DCA2E6C7A10415CAF6B8AB6661B3154");
configuration.setRemoveUrl("https://www.contoso.com/Orders/2DCA2E6C7A10415CAF6B8AB6661B3154/uninstallTab");
teamsTab.setConfiguration(configuration);
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("teamsApp@odata.bind", "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/06805b9e-77e3-4b93-ac81-525eb87513b8");
teamsTab.setAdditionalData(additionalData);
TeamsTab result = graphClient.chats().byChatId("{chat-id}").tabs().post(teamsTab);
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.teams_tab import TeamsTab
from msgraph.generated.models.teams_tab_configuration import TeamsTabConfiguration
# To initialize your graph_client, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = TeamsTab(
display_name = "My Contoso Tab",
configuration = TeamsTabConfiguration(
entity_id = "2DCA2E6C7A10415CAF6B8AB6661B3154",
content_url = "https://www.contoso.com/Orders/2DCA2E6C7A10415CAF6B8AB6661B3154/tabView",
website_url = "https://www.contoso.com/Orders/2DCA2E6C7A10415CAF6B8AB6661B3154",
remove_url = "https://www.contoso.com/Orders/2DCA2E6C7A10415CAF6B8AB6661B3154/uninstallTab",
),
additional_data = {
"teams_app@odata_bind" : "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/06805b9e-77e3-4b93-ac81-525eb87513b8",
}
)
result = await graph_client.chats.by_chat_id('chat-id').tabs.post(request_body)