MHugh
MHugh

Reputation: 465

How to send user identification when a user interacts with an adaptive card in a Teams Message

We are using the graph API to send a message to the General channel of a Microsoft Team, which has a number of members.

We would like to allow any members to interact with the message via an adaptive card.

This is doable using say Action.OpenUrl or .Submit, however we need to know which user it is which is interacting. I imagine this must be a fairly common thing to do.

What solutions and options are available to do this?

For example, is it possible to obtain the user's Team id at the time an action is invoked ?

Upvotes: 0

Views: 396

Answers (1)

Kyle Delaney
Kyle Delaney

Reputation: 12284

Every activity sent to the bot has a from property that identifies the user that sent the activity. You can see the full activity schema here. I advise you to run your bot in debug mode so that you can see all the data your bot receives. If you want to run your bot in debug mode and talk to the bot using Teams instead of Emulator, you can use tunneling: https://learn.microsoft.com/azure/bot-service/bot-service-debug-channel-ngrok

Upvotes: 2

Related Questions