Getting 400 Bad Request with Error code 'noResolvedUsers' when granting permission to a valid email address using Microsoft Graph API

Rakesh Kumar Joshi 11 Reputation points
2021-06-16T09:50:49.66+00:00

The below graph endpoint is used to grant access to the recipients on a drive item.

POST /drives/{drive-id}/items/{item-id}/invite  

We are getting 400 Bad Request with Error code noResolvedUser, when a valid email address is added as recipient.

Request Method: POST  
https://graph.microsoft.com/v1.0/drives/b\u00219b-VFEZXFE2F6XaM23GxN8X-1eQtnPNKnMeB6Rp23ucBGLuKk3pmT5OkkLL5Q1l7/items/01Q2A2TZG5GSOV2XYB7FEKPGK4VD6S7OI3/invite  
  
Status Code: 400 Bad Request  
client-request-id: e1646495-3606-4e49-88ad-2d977d284164  
Cache-Control: no-cache  
Content-Type: application/json  
  
"error": {  
    "code": "noResolvedUsers",  
    "message": "One or more users could not be resolved.",  
    "innerError": {  
        "date": "2021-06-15T08:41:35",  
        "request-id": "607b3ce3-e29b-45a9-9942-7528e43fe8b4",  
        "client-request-id": "e1646495-3606-4e49-88ad-2d977d284164"  
    }  
}  

We could not find documentation for the error code 'noResolvedError'.

Many tenants are experiencing this. Knowing what is causing this error and how to fix it will be a great help.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,002 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. MichaelHan-MSFT 18,031 Reputation points
    2021-06-17T08:28:37.767+00:00

    Hi @Rakesh Kumar Joshi ,

    Is the recipient exteranl users? I could reproduce your issue if the recipient is external user.

    To solve this, we need to change the organization-level external sharing setting to Anyone.

    106544-image.png

    Please refer to the following articles for more:

    https://learn.microsoft.com/en-us/sharepoint/turn-external-sharing-on-or-off
    https://learn.microsoft.com/en-us/sharepoint/change-external-sharing-site


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    If the response is helpful, please click "Accept Answer" and upvote it.


  2. Magnus Mjøsund 6 Reputation points
    2021-08-05T15:14:24.203+00:00

    @MichaelHan-MSFT Will the Root Site sharing setting override global sharing policy and site specific sharing policy? This seems to be the culprit, but is not an option for our customer.

    0 comments No comments

  3. Karum 1 Reputation point
    2021-11-13T18:51:24.947+00:00

    The solution to this issue is to modify the External Sharing settings on the Root site to which the actual site belongs.

    In summary, the Tenant, Root site, and Site must allow for external access for guest users. However, there is a bug where a Guest can be added to the individual driveitem in a site via the UI and successfully open and edit the document. This is not possible through GraphAPI, which is causing the 400 Bad Request error.

    0 comments No comments

  4. Jason Charnley 1 Reputation point
    2022-10-27T08:07:35.403+00:00

    Am getting the same error using POST /drives/{drive-id}/items/{item-id}/invite

    I have two tenants both have the same configuration from a SharePoint/Azure perspective however, I am not sure how to fix this. Strange thing though, with one of the tenants the endpoint works from the Graph Explorer, for the first invite only! after a successful response I cannot do it again, I get noResolvedUsers error.

    From the application using MS Graph it is never successful.

    I am going to try POST /sites/{siteId}/drive/items/{itemId}/invite

    However, I need to other tenant to grant me Sites.ReadWrite.All first, which is a pain as it's a large global organization

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.