Cannot Create Subscription - MS Graph Doesn't Post to Server RRS feed

  • Question

  • I'm trying to create a subscription in MS Graph, however it doesn't seem to send a POST request to verify the request to my server as per documentation (https://docs.microsoft.com/en-us/graph/webhooks).

    I'm posting the following (with URL altered for privacy) to: https://graph.microsoft.com/v1.0/subscriptions

    {"changeType": "created",
    "notificationUrl": "https://[mysite.com]/ms/webhook.cfm",
    "resource": "/me/mailfolders('inbox')/messages",
    "expirationDateTime": "2019-05-03T00:00:00.0000000Z",
    "clientState": "SecretClientState"

    and I receive back:

    { "error": { "code": "InvalidRequest", "message": "Subscription validation request failed. Response must exactly match validationToken query parameter.", "innerError": { "request-id": "676fd009-0756-4e73-9753-e8a6fed1bee5", "date": "2019-05-02T14:40:30" } } }

    When I hit the notification page myself, I receive the following response headers:

    HTTP/1.1 200 OK
    Content-Type: text/plain;charset=UTF-8
    Server: Microsoft-IIS/8.5
    X-Powered-By: ASP.NET
    Date: Thu, 02 May 2019 14:33:23 GMT
    Content-Length: 12

    and the body is a decoded version of whatever value I give the ValidationToken URL variable.

    In testing, the MS Graph POST that is supposed to occur to the notificationURL doesn't appear to be happening. The page is set to log whenever it is hit, but there is no log when I send my POST to MS Graph to create the subscription.

    Any recommendations would be greatly appreciated.

    Thursday, May 2, 2019 3:32 PM