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...
XDeveloper29
Copper Contributor
Nivedipa-MSFT
Thank you for the guidance.The documentation link provided describes how to send a message in a chat. However, my requirement is to send a message using a bot's name , instead of username. Is there any specific endpoint or configuration needed to achieve this using the Microsoft Graph API?
Thank you for the guidance.The documentation link provided describes how to send a message in a chat. However, my requirement is to send a message using a bot's name , instead of username. Is there any specific endpoint or configuration needed to achieve this using the Microsoft Graph API?
XDeveloper29
Jul 29, 2024Copper Contributor
Nivedipa-MSFT, Kindly help on the above discussion.
- Nivedipa-MSFTJul 29, 2024Microsoft
XDeveloper29 - 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.
- XDeveloper29Jul 29, 2024Copper ContributorNivedipa-MSFT, Thank you for the guidance, I will check & update.