Webhook not performing subscription validation

半腔热情 提交于 2020-06-28 04:42:09

问题


We are creating a Webhook/Subscription using Microsoft Graph. However, the following JSON is returned and we can see no corresponding HTTP request to our validation public web server:

"error": {
    "code": "InvalidRequest",
    "message": "Subscription validation request failed. Must respond with 200 OK to this request.",
    "innerError": {
        "request-id": "d2c4eeca-1bf9-4657-a904-ba6925428bbd",
        "date": "2018-02-24T17:19:56"
    }
}

Our HTTP POST request to https://graph.microsoft.com/v1.0/subscriptions contains this JSON:

{
    "changeType": "created,updated",
    "clientState": "subscription-identifier",
    "expirationDateTime": "2018-02-27T15:46:18.835Z",
    "notificationUrl": "https://[public_web_server]/api/watl/o365",
    "resource": "Users/[email address]/mailfolders('inbox')/messages"
}

When testing the request via Hurl.it and other online HTTP requests we can see the request hit our web server. However, we can not see anything coming from Microsoft Graph.

Our web server is responding with a 200 OK and including the ValidationToken as the body.

Any suggestions?


回答1:


The error seems to be happening because the notification URL provided in the request payload does not accept media type "text/plain". Can you make the change and try again?



来源:https://stackoverflow.com/questions/48965662/webhook-not-performing-subscription-validation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!