Forum Discussion

XDeveloper29's avatar
XDeveloper29
Copper Contributor
Jul 24, 2024

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 authenticated account. However, I want the replies to appear as if they're coming from the bot itself, using the application name registered in the Azure portal. The bot is also registered as a message extension app. Ideally, I want the responses to display the bot's name, rather than the username of the account making the API call. Here are the steps I'm currently following:
  1. The bot is authenticated and authorized using OAuth2 with the appropriate permissions.
  2. I use the /reply Or /message endpoint to send messages.

I know we can use incoming webhook, but we can't use it.

 

What I'm looking for:

Any specific configurations needed in the Azure portal or Microsoft Graph API to achieve this. How to Send the message with the bot's name instead of the user's name.

 

Any help would be greatly appreciated!

  • 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. 

     

    • XDeveloper29's avatar
      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?

Resources