通过Rest Api的Microsoft Graph Api Webhook订阅不再起作用

编程入门 行业动态 更新时间:2024-10-10 01:21:21
本文介绍了通过Rest Api的Microsoft Graph Api Webhook订阅不再起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个正在运行的应用程序,可以从MS-Graph Api接收电子邮件Webhook事件. 我注意到我找不到使用subscriptionId的订阅,却收到404错误.我也无法使用ID删除订阅.

I have a working application that receive email webhook events from MS-Graph Api. I noticed that I could not find the subscription back using the subscriptionId, I get a 404 error.I also cannot delete the subscription using the id.

我进行了进一步调查,发现我不能再创建新的订阅了: 在Azure AD中注册的应用程序是服务应用程序(守护程序)

I investigated further and noticed that I cannot create new subscriptions anymore: The Application registered in Azure AD is a service-application (daemon)

我的应用程序会自动续订订阅,并且每次更新都会收到202响应,但不知何故订阅会丢失.

My application auto renews the subscriptions and every time it did that I get a 202 response, but somehow the the subscription gets lost.

请求:

POST: graph.microsoft/beta/subscriptions

{ "changeType": "created,updated,deleted", "notificationUrl": "myapi.azurewebsites/GraphWebhook/Inbox", "resource": "Users/myemail@company.nl/mailFolders('inbox')/messages", "expirationDateTime":"2016-10-25T20:23:45.9356913Z", "clientState": "subscription-identifier" }

{ "changeType": "created,updated,deleted", "notificationUrl": "myapi.azurewebsites/GraphWebhook/Inbox", "resource": "Users/myemail@company.nl/mailFolders('inbox')/messages", "expirationDateTime":"2016-10-25T20:23:45.9356913Z", "clientState": "subscription-identifier" }

响应:

"error": { "code": "ExtensionError", "message": "Operation: Create; Exception: [Status Code: NotFound; Reason: Not Found]", "innerError": { "request-id": "681ac550-be6f-4882-9b6b-e089c36ad38e", "date": "2016-10-25T10:13:25" }

有人有什么想法吗?

更新:立即重新工作.

UPDATE: Working now again out of the blue.

推荐答案

该API支持用户ID和用户电子邮件地址作为资源路径的一部分,并且不进行更改.要检查是API问题还是资源问题,您可以尝试使用图形浏览器访问资源:

The API supports both user id and user email address as part of resource path and it DOES NOT change. To check whether it is API issue or resource issue, you could try to access your resource using graph explorer:

获取 graph.microsoft/beta/users/myemail@company.nl/mailFolders ('inbox')/messages

GET graph.microsoft/beta/users/myemail@company.nl/mailFolders('inbox')/messages

关于您在创建订阅时看到的错误,它看起来像是与此相关的Exchange问​​题.

Regarding the error you saw when creating subscription, it looks like an Exchange issue related to this.

希望这会有所帮助.

更多推荐

通过Rest Api的Microsoft Graph Api Webhook订阅不再起作用

本文发布于:2023-11-23 01:03:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1619546.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Api   Rest   Microsoft   Webhook   Graph

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!