Forum Discussion
How to Send Replies in Microsoft Teams Using Bot Name Instead of Username via Graph API?
XDeveloper29 - Thanks for reporting your issue.
To send replies in Microsoft Teams using the bot's name instead of the username via the Microsoft Graph API /chats/{chat-id}/messages
Send message in a chat - Microsoft Graph v1.0 | Microsoft Learn
Thanks,
Nivedipa
------------------------------------------------------------------------------------------
If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.
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?
- XDeveloper29Jul 29, 2024Copper ContributorNivedipa-MSFT, Kindly help on the above discussion.
- Nivedipa-MSFTJul 29, 2024
Microsoft
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.