Hello,
We are getting an error noResolvedUsers - One or more users could not be resolved.
POST /drives/{drive-id}/items/{item-id}/invite
We implemented an adapter that is able to share documents to external users on sharepoint using Microsoft Graph API. We found out that sharing doesn't work if this specific checkbox is checked:

As you can see here Sharepoint and OneDrive have Content sharing setup to "Anyone". We also setup root site and the specific site and put there that the links can be shared with anyone, so the issue doesnt seem to be there. Here is settings that we have on the root site and the site we are working with:

Unfortunatelly we cannot uncheck that checkbox as our customer needs the mentioned functionality as well.
If we uncheck it, it works just fine regardles of other security settings, but that is not a solution for us
If we change other security settings like the sliding bars "Content can be shared with" it still works but as soon as we check the "Allow only users in specific security groups to share externally" it stops working.
We are communicating with the graphAPI as an application. We also tried to communicate as a delegate role but we were still unable to make it work. This problem persists regardless. We use the API for other functions like creating folders and changing their attributes - that works just fine, the API is setup correctly.
There seems to be an issue with Microsoft Graph API.
I will also link the articles and other questions i found on this topic. Most of them mention seting up visibility to Anyone, but unfortunatelly that doesnt work as it seems Microsoft Graph api is ignoring it.
Here are related articles:
- [https://learn.microsoft.com/en-us/answers/questions/438419/getting-400-bad-request-with-error-code-noresolved
- [https://stackoverflow.com/questions/68000102/getting-400-bad-request-with-error-code-noresolvedusers-when-granting-permissi
- [https://github.com/OneDrive/onedrive-api-docs/issues/1497
This issue seems to be mentioned several times but never actually resolved.