Search code examples
microsoft-graph-apimicrosoft-graph-calendar

Microsoft Graph API Rich Notification not enabled for Calendar Events


I'm trying to subscribe to changes on an outlook calendar. Therefore I'm using the Microsoft Graph APIs Endpoint: https://graph.microsoft.com/beta/subscriptions. I'm following the documentation provided here: https://learn.microsoft.com/en-us/graph/change-notifications-with-resource-data and here https://learn.microsoft.com/en-us/graph/api/resources/event?view=graph-rest-1.0

My Request is the following: I also tried v1.0 and the beta endpoint

POST https://graph.microsoft.com/beta/subscriptions
{
"changeType": "created,updated,deleted",
"clientState": "secretClientValue",
"expirationDateTime": "2024-03-23T11:58:28.7332748Z",
"latestSupportedTlsVersion": "v1_2",
"notificationUrl": "https://prod-26.germanywestcentral.logic.azure.com:443/workflows/%5C*%5C*%5C*%5C%5C\*
"resource": "/users/idretracted/events$select=subject",
"includeResourceData": true,
"encryptionCertificate": "MIIDUDCCAjigAwIBAgIQB5knH1a....",
"encryptionCertificateId": "mycertificateID"
}

I get the Response:

{
    "error": {
        "code": "InvalidRequest",
        "message": "Azure Active Directory workload is not enabled for rich notifications.",
        "innerError": {
            "date": "2024-03-20T16:32:39",
            "request-id": "048ab9b5-f44b-49aa-9******",
            "client-request-id": "0488fda5-e1fa-f1d5-*******"
        }
    }
}

From the documentation it says that Outlook events are supported for rich notifications, so im wondering what im doing wrong. Any help is appreciated.

All the other stackoverflow questions regarding this topic are >2 years old.


Solution

  • Your resource doesn't look correct eg

    "resource": "/users/idretracted/events$select=subject",
    

    your missing the navigation end separator eg "?" so it should be

    "resource": "/users/idretracted/events?$select=subject",
    

    this would cause your subscription to fail to be interrupted correctly, rich notifications should work fine on events