Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MS Teams: send message to private chat programmatically

I try to find a way to send a private message in MS Teams' personal chattings.

I know that in 'channel > connector', I can use a webhook to achieve this. Unfortunately, I can not find anything like that in personal chattings.

The only thing related I find is MS Graph API, but it's not what I looking for.

enter image description here

Currently, I am trying to use emailing API as the alternative

enter image description here

Any suggestions would be appreciated, thanks.

like image 593
han shih Avatar asked Nov 07 '25 22:11

han shih


1 Answers

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" (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 .

like image 94
Hilton Giesenow Avatar answered Nov 09 '25 13:11

Hilton Giesenow



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!