I am working with Microsoft Bot Framework SDK v3, as well as v4, for node.js. I have one v3 bot & one v4 bot, both with MS teams channel, but I'm not able to get users' profile details in bot code for v4 bot. (exactly looking for userprincipalname )
In v3 I'm using TeamsChatConnector which has fetchMembers() which fetches users details, but things have changed in v4. It is also known as 'Fetching the team roster'. Here is the documentation
In the v4 bot, there is BotFrameworkAdapter which is not specific to MS teams or any other channel. If I inspect activity object, I can see from the 'from' property, it only has user's name:'lastName,First name' AND AAD object id, but not userprincipalname which is usually an email address.
How can I get access to users email address or userprincipalname in v4 BOT code if users is using MS teams channel?
connector.fetchMembers(
(<builder.IChatConnectorAddress>session.message.address).serviceUrl,
conversationId,
(err, result) => {
if (err) {
session.endDialog('There is some error');
}
else {
session.endDialog('%s', JSON.stringify(result));
}
}
);