Skip to content

Instantly share code, notes, and snippets.

@ktskumar
Created March 16, 2020 10:40
Show Gist options
  • Save ktskumar/06402a7c274e2884f04483bd458fd51d to your computer and use it in GitHub Desktop.
Save ktskumar/06402a7c274e2884f04483bd458fd51d to your computer and use it in GitHub Desktop.
Get Grah User using SharePoint RRST API
//getRequest method reference
//https://gist.github.com/ktskumar/a9e9df497673e9fd26ead8532b9ff425
//Returns the profile and ms graph related user information
getRequest("https://domain.sharepoint.com/sites/webname/_api/SP.Directory.DirectorySession/GetGraphUser(principalName='[email protected]')")
.then(function(output){
console.log(JSON.parse(output.response));
});
//Returned Properties
//aboutMe, alias, birthday, displayName, hireDate, id, Interests, mail, mySite, pastProjects,
//pointPulishingPersonalSiteUrl, preferredName, principalName, responsibilities, schoools, skilss, tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment