Skip to content

Latest commit

 

History

History
40 lines (32 loc) · 1.45 KB

add-tab-to-chat-go-snippets.md

File metadata and controls

40 lines (32 loc) · 1.45 KB
description
Automatically generated file. DO NOT MODIFY
// Code snippets are only available for the latest major version. Current major version is $v1.*// Dependenciesimport ( "context" msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go" graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"//other-imports ) requestBody:=graphmodels.NewTeamsTab() displayName:="My Contoso Tab"requestBody.SetDisplayName(&displayName) configuration:=graphmodels.NewTeamsTabConfiguration() entityId:="2DCA2E6C7A10415CAF6B8AB6661B3154"configuration.SetEntityId(&entityId) contentUrl:="https://www.contoso.com/Orders/2DCA2E6C7A10415CAF6B8AB6661B3154/tabView"configuration.SetContentUrl(&contentUrl) websiteUrl:="https://www.contoso.com/Orders/2DCA2E6C7A10415CAF6B8AB6661B3154"configuration.SetWebsiteUrl(&websiteUrl) removeUrl:="https://www.contoso.com/Orders/2DCA2E6C7A10415CAF6B8AB6661B3154/uninstallTab"configuration.SetRemoveUrl(&removeUrl) requestBody.SetConfiguration(configuration) additionalData:=map[string]interface{}{ "teamsApp@odata.bind" : "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/06805b9e-77e3-4b93-ac81-525eb87513b8", } requestBody.SetAdditionalData(additionalData) // To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=gotabs, err:=graphClient.Chats().ByChatId("chat-id").Tabs().Post(context.Background(), requestBody, nil) 
close