We have been having a problem in granting users permissions on certain documents in SharePoint using graph API
The Idea is to use /sites/{siteId}/drive/items/{itemId}/invite graph API to grant users permission on document level, we have followed the instructions as stated in [this][1] Microsoft Documentation and the API call works fine for internal users in our tenant but when we try it out with external user it fails and show us this error in the API response "One or more users could not be resolved"
below is an example of the API call https://graph.microsoft.com/v1.0/sites/{SiteID}/drive/items/{ItemId}/invite body:
{
"requireSignIn": true,
"sendInvitation": true,
"roles": [ "read"],
"recipients": [
{"email":"{externalEmailValue}"}
]
}
Headers:
Authorization: bearer {token}
any idea why it is not working for external users? the Azure App used for generating the token is configured correctly, and the API call works fine for internal users [1]: https://learn.microsoft.com/en-us/graph/api/driveitem-invite?view=graph-rest-1.0&tabs=http