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.
1 Answer
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('[email protected]')/Id
Alternatively you could utilize the following query:
/_api/web/SiteUsers?$select=id&$filter=Email eq '[email protected]'