The drive is a normal folder created on a sharepoint site(not a private OneDrive) with documents in the given drive-id. I can grant the given user permissions through the SharePoint UI.
When calling POST to /drives/{drive-id}/items/{item-id}/invite endpoint using Graph API explorer with this body:
{
"recipients": [
{
"email": "{user-email}"
}
],
"message": "",
"requireSignIn": true,
"sendInvitation": false,
"roles": [
"write"
]
}
I get a response OK - 200 - 566ms with response body being:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(permission)",
"value": [
{
"@odata.type": "#microsoft.graph.permission",
"id": "{id}",
"roles": [
"write"
],
"grantedTo": {
"user": {
"email": "{correct-user-email}",
"id": "{correct-user-id}",
"displayName": "{correct-user-displayName}"
}
}
}
]
}
This response contains only deprecated grantedTo without grantedToV2, and the user does not have the proper permissions for the given driveItem when I check it on SharePoint.