How to retrieve user's details from MS Teams?

Hello guys,

I have integrated Rasa with MS Teams. In order to do this I’ve used Azure Bot Service. The problem is that I need to retrieve a user’s details from MS Teams, namely an email address of the logged user. The only thing about the user that I have so far is sender_id but I don’t know how could I use it. Also I’m aware that there is a Microsoft Bot Framework documentation (mentioned in the post here) which should explain how to perfom this action but I can’t figure out how to execute it in a custom action. I know that it’s possible according to the mentioned post - could you describe the steps needed to receive user’s details from MS Teams?

i resolved this problem by creating a custom channel. I create a new channel that extends MS Botframework. after that I added the function to request the user information from MS Graph.

Hi Spectre, Unfortunately i am unable to not getting any response .Is there any github where you can share modified botframework.py

Hi Spectre, As suggested, I tried by creating custom botframework.py with the mentioned _get_conversation_members function under BotFramework(OutputChannel) class. How to capture self.members into action.py to utter_message with the username or email ?

If you have conversation_id, you can refer to my get_email method in MSTeamsHelper (refer to attached gist below) to call MSTeams API and fetch the user email.

The following are the links to my custom botframework connector and MSTeams helper if it helps:

MSTeamsHelper.py

botframework.py

@maximus - Are you able to implement it? If yes can you please share the steps