Microsoft Graph API notification on invite to a folder/file is not working

JUAN TOMAS FERRER 20 Reputation points
2024-12-04T13:56:16.1166667+00:00

We built an Application to automatically share folders based on a management website we have.
It stopped working since 07/11/2024, we thought that it was on our end.
Today we stripped all the permissions and gave the ones we think are needed on both App and Delegated scopes:
Files.ReadWrite
Users.InviteAll

We use this POST request:
https://graph.microsoft.com/v1.0/users/{UID}/drive/root:/{PATH}/invite

{
  "recipients": [
    {
      "email": "******@contoso.com"
    }
  ],    
  "message": "You have been invited to access the folder.",
  "requireSignIn": true,
  "sendInvitation": true,
  "roles": ["read"]
}

And we get this reponse:

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(microsoft.graph.permission)",
    "value": [
        {
            "roles": [
                "read"
            ],
            "grantedToIdentities": [
                {
                    "user": {
                        "email": "******@contoso.com"
                    }
                }
            ],
            "invitation": {
                "signInRequired": true
            },
            "link": {
                "type": "view",
                "webUrl": "https://domain-my.sharepoint.com/:f:/g/personal/user_domain_onmicrosoft_com/key"
            }
        }
    ]
}

Link works, but the email is never beeing received by any user, checking the logs of our script it has been like this since 07/11/2024.
Tried deleting all the folders and permissions (we had errors before with this if the admin user real email was in the share list for some reason).
Tried different email domains to see if we were getting problems because of that too.

But no luck.

Microsoft 365 and Office | OneDrive | For business | Windows
Microsoft Security | Microsoft Graph
{count} votes

Accepted answer
  1. Anonymous
    2024-12-05T09:03:32.5466667+00:00

    Hello JUAN TOMAS FERRER,

    Thank you for reaching out to Microsoft Support!

    Based on the previous user feedback, the inability to send mail with application permissions is a known problem, but it works well with delegated permissions. We did the test according to your request path, but reported 400 errors, so we did the test according to the path of the document, the test result is as follows, and the email can be received in the mailbox.

    Screenshot 2024-12-05 090022

    User's image

    For your problem, please try again in Graph Explorer. See the documentation for the request path.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.