3

Is there a way to get a users PrincipalId based on their email address. I'm looking to share/apply permissions to files and folders in a users OneDrive to Business drive using the REST API.

3

SP.UserCollection object contains the SP.UserCollection.getByEmail Method to get the user with the specified email address. The following example demonstrates how to get SP.User Id property:

/_api/web/SiteUsers/getByEmail('username@contoso.onmicrosoft.com')/Id

Alternatively you could utilize the following query:

/_api/web/SiteUsers?$select=id&$filter=Email eq 'username@contoso.onmicrosoft.com'
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.