Forum Discussion
XDeveloper29
Jul 24, 2024Copper Contributor
How to Send Replies in Microsoft Teams Using Bot Name Instead of Username via Graph API?
I'm working on an external application that sends replies to messages in Microsoft Teams using the Microsoft Graph API. Currently, the replies are sent using the username associated with the authen...
Nivedipa-MSFT
Microsoft
Jul 29, 2024XDeveloper29 - You can send a message using Graph API, but not as the bot.
Instead of using the Graph, there's another approach using the Bot Framework itself, to send a message to a team channel, a group chat, or a 1-1 conversation. The code doesn't even need to live inside the bot itself, it just needs to leverage the bot framework under the covers (for example, I have several Azure Functions that pro-actively message users). This idea is called "Proactive messaging" and you can read more about it in the docs here.
You do need to get certain fields when the user first installs the bot though, or any time the bot receives a message. I've described that more at Programmatically sending a message to a bot in Microsoft Teams.
XDeveloper29
Jul 29, 2024Copper Contributor
Nivedipa-MSFT, Thank you for the guidance, I will check & update.