400 Malformed Request: /sites/{id}/drives/{id}/items/{id}/invite

Brennan Aldridge 1 Reputation point
2021-02-17T14:24:09.483+00:00

I am sharing a SharePoint file via SPFX Framework solution and Graph API endpoint:
/sites/{id}/drives/{id}/items/{id}/invite

I am seeing intermittent errors, based on who shares the file, and to which users the file is shared. The error returned is: 400 - The request is malformed or incorrect.

I can reproduce this error in Graph Explorer, and the code is correct based on MS documentation.

Any advice on what conditions result in this error being returned? In particular why would user1@domainA.com work, but the same body with recipient email user2@domainB.com result in malformed error?

Thanks in advance!

{
"recipients": [
{
"email": "user@keyman .com"
}
],
"message": "Test",
"requireSignIn": true,
"sendInvitation": true,
"roles": [
"read"
]
}

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,155 questions
{count} votes