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:
- Bot sends user in chat a welcome message: "Hello!" with a button "Manage profile"
- User clicks "Manage profile" button
- Bot will send "Manage profile" message on behalf of user such that it looks like the message is coming from user
- 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?