0

I have a use case for when user clicks on a button in a bot message from my custom MS Teams app, I would like bot to send message on behalf of user with the button text.

Example:

  1. Bot sends user in chat a welcome message: "Hello!" with a button "Manage profile"
  2. User clicks "Manage profile" button
  3. Bot will send "Manage profile" message on behalf of user such that it looks like the message is coming from user
  4. Bot will execute "Manage profile" button payload and request

In the chat, it will look something like:

Bot: "Hello!" (with button: "Manage profile")

User: "Manage Profile"

I am currently able to use the {serviceUrl}/conversations/conversationId/activities to send bot message by using the access token obtained from https://login.microsoftonline.com/botframework.com/oauth2/v2.0/token.

I saw documentation for sending chatMessage (https://learn.microsoft.com/en-us/graph/api/chatmessage-post?view=graph-rest-1.0&tabs=http) and wasn't sure if this might be the solution? If so, do I need a different access token for using this?

hello12345
  • 11
  • 1
  • Got the related thread-https://stackoverflow.com/questions/58602926/sending-messages-in-teams-with-a-bot-on-behalf-of-a-user hope it's helpful. – Sayali-MSFT Sep 30 '22 at 18:23
  • Does this answer your question? [Sending messages in Teams with a bot on behalf of a user](https://stackoverflow.com/questions/58602926/sending-messages-in-teams-with-a-bot-on-behalf-of-a-user) – Eugene Astafiev Oct 15 '22 at 13:21

0 Answers0