How can an external service create a new chat message within a Teams channel?

%3CLINGO-SUB%20id%3D%22lingo-sub-1645317%22%20slang%3D%22en-US%22%3EHow%20can%20an%20external%20service%20create%20a%20new%20chat%20message%20within%20a%20Teams%20channel%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1645317%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20want%20to%20provide%20a%20way%20for%20our%20external%20service%20to%20send%20chat%20message%20notifications%20to%20a%20specified%20Teams%20channel%20when%20an%20action%20happens%20on%20our%20platform.%26nbsp%3B%20We%20started%20by%20registering%20an%20app%20within%20our%20Azure%20portal%2C%20and%20then%20tried%20to%20execute%20a%20POST%20using%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fchannel-post-messages%3Fview%3Dgraph-rest-1.0%26amp%3Btabs%3Dhttp%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3EchatMessage%3C%2FA%3E%2C%20but%20got%20a%20permissions%20error.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fchannel-post-messages%3Fview%3Dgraph-rest-1.0%26amp%3Btabs%3Dhttp%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Edocumentation%20for%20chatMessage%3C%2FA%3E%2C%20it%20seems%20that%20permission%20type%20Application%20is%20%22Not%20supported%22.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20that's%20the%20case%2C%20what's%20the%20appropriate%20way%20for%20an%20external%20service%20to%20send%20notifications%20to%20appear%20as%20chat%20messages%20in%20a%20Teams%20channel%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1645317%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1647090%22%20slang%3D%22en-US%22%3ERe%3A%20How%20can%20an%20external%20service%20create%20a%20new%20chat%20message%20within%20a%20Teams%20channel%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1647090%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F700141%22%20target%3D%22_blank%22%3E%40cozimek%3C%2FA%3E%26nbsp%3B-%20You%20can%20send%20messages%20to%20Teams%20from%20external%20service%20using%20connectors%20-%20could%20you%20please%20check%20this%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fplatform%2Fwebhooks-and-connectors%2Fwhat-are-webhooks-and-connectors%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Edocs%3C%2FA%3E%20also%20could%20you%20please%20check%20this%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FOfficeDev%2Fmicrosoft-teams-sample-connector-csharp%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Esample%3C%2FA%3E%20%3F%20try%20if%20that%20helps.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

We want to provide a way for our external service to send chat message notifications to a specified Teams channel when an action happens on our platform.  We started by registering an app within our Azure portal, and then tried to execute a POST using chatMessage, but got a permissions error.

 

In the documentation for chatMessage, it seems that permission type Application is "Not supported".

 

If that's the case, what's the appropriate way for an external service to send notifications to appear as chat messages in a Teams channel?

2 Replies

@cozimek - You can send messages to Teams from external service using connectors - could you please check this docs also could you please check this sample ? try if that helps.

@Nikitha-MSFT thanks for the links. We've done some research on connectors, and from a usability perspective for our audience, our hope is that we can configure the destination Teams channel from our app, rather than having to have the client find the app in the Teams app store, install it, configure it, etc.  For now, I think we're looking at using inbound webhooks, but it sounds like being able to leverage Microsoft Graph API to let apps send notifications via a chat message soon.  I hope!