Microsoft Graph WebHook:订阅验证令牌为空? [英] Microsoft Graph WebHook: Subscription validationtoken blank?

查看:109
本文介绍了Microsoft Graph WebHook:订阅验证令牌为空?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为消息设置MS Graph Webhook订阅,但是Graph似乎正在发送一个空白的validationToken.我正在连接到 https://graph.microsoft.com/beta/subscriptions

我的API终结点在Postman中工作,并且仅返回带有validationtoken的成功纯文本响应,但是当我调用MS Graph时,出现以下错误订阅验证请求失败.响应必须与validationToken查询参数完全匹配".我还尝试了validationtoken和validationToken作为要查找的参数.

完整的错误消息

"{\r\n  \"error\": {\r\n    \"code\": \"InvalidRequest\",\r\n    \"message\": \"Subscription validation request failed. Response must exactly match validationToken query parameter.\",\r\n    \"innerError\": {\r\n      \"request-id\": \"f1546835-606d-4bd8-ab3c-dfb2c75285aa\",\r\n      \"date\": \"2018-08-10T03:45:56\"\r\n    }\r\n  }\r\n}"

解决方案

要创建订阅,您需要使用https公开通知URL(您可以在https://graph.microsoft.com/beta/subscriptions

My API endpoint works in Postman and successfully returns a plaintext response with only the validationtoken, but when I call MS Graph, I get the following error "Subscription validation request failed. Response must exactly match validationToken query parameter". I've also tried both validationtoken and validationToken as the parameter to look for.

Full error message

"{\r\n  \"error\": {\r\n    \"code\": \"InvalidRequest\",\r\n    \"message\": \"Subscription validation request failed. Response must exactly match validationToken query parameter.\",\r\n    \"innerError\": {\r\n      \"request-id\": \"f1546835-606d-4bd8-ab3c-dfb2c75285aa\",\r\n      \"date\": \"2018-08-10T03:45:56\"\r\n    }\r\n  }\r\n}"

解决方案

To create a subscription you need to expose a notification URL with https (You can look at Graph documentation at https://developer.microsoft.com/en-us/graph/docs/concepts/webhooks).

When you send your create subscription request, the first post message your notification URL will receive is a message with a validation token. You have to send this validation token back. Now you should receive notifications on your specified notification URL. Looking at this failure, it looks like the notification URL is not sending the validation token back.

The response should not vary between Postman and MSGraph. If you are still seeing issues, please share your notification url and we will try to get a repro.

这篇关于Microsoft Graph WebHook:订阅验证令牌为空?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆