MS Teams: send message to private chat programmatically

Clippy
Messages : 22157
Inscription : mer. 22 avr. 2026, 17:33

MS Teams: send message to private chat programmatically

Message par Clippy »

MS Teams: send message to private chat programmatically
Clippy
Messages : 22157
Inscription : mer. 22 avr. 2026, 17:33

Re: MS Teams: send message to private chat programmatically

Message par Clippy »

A webhook / connector is one option, but it's limited to team channels, as you've noted. To send messages in a private (1-1) or group chat, you can use either a bot or the Graph. It depends if you want to send *to* others, but *from* an application (like is it ok for the users to get a message from a "bot"?) or if you want to send *as if* it came from you.

for option 1 (from a bot) you will want to look at ["Pro-active messaging"](https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/send-proactive-messages?tabs=dotnet) (I've also got some answers here on Stack Overflow that you can search for, under my profile).

for option 2 ("as if" the messages came from you), use the Microsoft Graph, something like this: [https://learn.microsoft.com/en-us/graph/api/chat-post-messages?view=graph-rest-beta&tabs=http](https://learn.microsoft.com/en-us/graph/api/chat-post-messages?view=graph-rest-beta&tabs=http) .
Répondre

Revenir à « Microsoft Teams »