Jobin Joseph
Jobin Joseph

Reputation: 110

Get SharePoint user detail via Azure Chat bot

I'm developing a chat bot using bot framework form flow to embed in SharePoint online for service ticket creation.

I have used iFrame for to attach it on share point online. Now I need to get the user name & Email ID of the user logged-in the share point site. Since the bot is hosted on Azure and using iFrame the below commands not applicable here

activity.ChannelId;
activity.From.Id;
activity.From.Name;

Upvotes: 0

Views: 515

Answers (1)

NaaHCat
NaaHCat

Reputation: 500

From what i understand that you want to get user' name and email ID from sharepoint online sites.

I suggest try graph API to get your user'data.

GET https://graph.microsoft.com/v1.0/users?$select=displayName,mail,userPrincipalName

References are here

For anonymous user or get access without user, you can try use the OAuth client credentials grant flow to get an access token.

  1. Register your app.
  2. List itemConfigure permissions for Microsoft Graph on your app.
  3. Get administrator consent.
  4. Get an access token.
  5. Use the access token to call Microsoft Graph.

For more detailed steps on how to register, here is the link.

Upvotes: 1

Related Questions