Search code examples
c#node.jsbotframeworkmicrosoft-teams

Get a list of user teams using MS bot framework


I am developing a bot for MS Teams.

Can I get a list of teams that the user is a member of, using the context from the private conversation message?


Solution

  • @Nazariy Perepichka When a user sends a message to the bot, the payload received by the bot contains the aadObjectId of the user who has sent the message. This will be listed under activity.From.AadObjectId. You could use that id to make a graph API call to get the list of teams that the user is part of. Please try this and let us know if you face any issues.