Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get user Email address in 1-1 Private conversation in Microsoft Teams #1736

Closed
satyansh-sagar opened this issue Aug 28, 2019 · 7 comments
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-replied-to Indicates that the team has replied to the issue reported by the customer. Do not delete. customer-reported Issue is created by anyone that is not a collaborator in the repository.

Comments

@satyansh-sagar
Copy link

How to get user email address in Private chat conversation in Microsoft teams. I'm using the v4 of bot framework.

If anyone can help me on this. :|

@msft-shahins @msftgits

@satyansh-sagar
Copy link
Author

I am getting the user name and AAD object ID.

@mdrichardson
Copy link
Contributor

The Microsoft Bot Framework team prefers that how to questions be submitted on Stack Overflow. The official Bot Framework Github repos are the preferred platform for submitting bug fixes and feature requests.


That being said, I answered a very similar question recently. You basically need to query Teams for the members in the conversation. That link contains how to do it in both Node and C#.

@mdrichardson mdrichardson added Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-replied-to Indicates that the team has replied to the issue reported by the customer. Do not delete. customer-reported Issue is created by anyone that is not a collaborator in the repository. labels Aug 28, 2019
@satyansh-sagar
Copy link
Author

The above link works fine fir a bot in channel where members are present. But the same thing is not working in 1-1 chat conversation.
thumbnail_image

@mdrichardson
Copy link
Contributor

@satyansh-sagar Interesting. I tested the Node code in a 1:1 conversation and it worked. I'll test the C# code today.

@mdrichardson mdrichardson reopened this Aug 29, 2019
@mdrichardson
Copy link
Contributor

@satyansh-sagar I see the issue. I think you're using the wrong bit of code from that answer for this. Use this:

var credentials = new MicrosoftAppCredentials("<yourAppId>", "<yourAppPassword>");
var connector = new ConnectorClient(new Uri(turnContext.Activity.ServiceUrl), credentials);
var conversationId = turnContext.Activity.Conversation.Id;
var userInfo = await connector.Conversations.GetConversationMembersAsync(conversationId );

image

And yes, this was in a 1:1 conversation:

image

@satyansh-sagar
Copy link
Author

satyansh-sagar commented Aug 30, 2019

Great! This worked for me. Thank a lot @mdrichardson :)

But Still I didn't got the issue root. Why that was coming as null for the C# SDK but the same thing working for node. :|

@mdrichardson
Copy link
Contributor

@satyansh-sagar Tough to say. It likely has something to do with the Teams Extension. Normally, I'd say we should track it down and then submit a PR to fix. However, we're working on rolling the Teams Extension into the Bot Framework SDK, so it will likely be fixed anyway.

@mdrichardson mdrichardson reopened this Aug 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-replied-to Indicates that the team has replied to the issue reported by the customer. Do not delete. customer-reported Issue is created by anyone that is not a collaborator in the repository.
Projects
None yet
Development

No branches or pull requests

2 participants