MS Team. Bot. TeamsInfo.GetMemberAsync returns 'Forbidden'

Occasional Contributor


Bot handles "Messaging Extension Query activity" (OnTeamsMessagingExtensionQueryAsync) request.

One by One chat (My User - User 1).

I need to know "My User" email address. I use 

await TeamsInfo.GetMemberAsync(turnContext, userId, cancellationToken);


- "Bot - My User" works. 

- "My User - User 1" 'Forbidden' ("message\":\"The bot is not part of the conversation roster.\")

- "My User - User 2" works.

1) What's the reason? Are there any limitations? 

2) Maybe there is additional way to get "my" account (email address , domain name)?

3) Are there any ways to put into cache the current user (loged in Teams) email address?

I need to know the email address (user domain name) in each action (activity).



2 Replies


Could you please share sample details which you are referring.It helps us to repro the issue.

best response confirmed by ChetanSharma-msft (Microsoft)
Workaround: I get 'TeamsChannelAccount' data (TeamsInfo.GetMemberAsync(...)) in "Bot-User" conversation (first step) and put it into 'UserState'. Then I can get and use it.
My Bot: "scopes": ["personal"]. Maybe this is the reason of the issue.