“找不到该段的资源";使用Graph订阅Beta [英] "Resource not found for the segment" using Graph subscription beta

查看:70
本文介绍了“找不到该段的资源";使用Graph订阅Beta的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Microsoft Graph获取具有应用程序许可权的日历事件.它完美地工作.现在,我正在尝试建立一个订阅以侦听事件更改,但是普通的v1.0不会对此提供支持.但是,至少在说明中,beta表示它有效.

Im using the Microsoft Graph to get calendar event with application permission. It works perfectly. Now Im trying to set up a subscription to listen to event changes however the normal v1.0 do not suport this. However beta, at least in the description, say it works.

在页面上: https://graph .microsoft.io/en-us/docs/api-reference/beta/api/subscription_post_subscriptions

注意:/beta端点允许将应用程序权限作为大多数资源的预览功能."

"Note: the /beta endpoint allows Application permissions as a preview feature for most resources."

因此,我尝试使用以下URL: https://graph.microsoft.com/beta/subscriptions

So I tried this with the URL: https://graph.microsoft.com/beta/subscriptions

发送这样的json对象:

Sending in a json object like this:

{ "changeType":创建,更新,删除", "notificationUrl":"https%3A%2F%2FXXX.com%2Fo365.php", "resource":%2Fusers%2Fooom%40xxx.com%2Fevents", "clientState":"1486588355561", "expirationDateTime":"2018-11-20T18:23:45.9356913Z" }

{ "changeType":"created,updated,deleted", "notificationUrl":"https%3A%2F%2FXXX.com%2Fo365.php", "resource":"%2Fusers%2Fooom%40xxx.com%2Fevents", "clientState":"1486588355561", "expirationDateTime":"2018-11-20T18:23:45.9356913Z" }

这样做我得到结果:

{ 错误": { "code":"BadRequest", "message":找不到段'/users/room@xxx.com/events'的资源.", "innerError":{ "request-id":"d9ca58b1-ee1f-4072-81d5-0f1a25dcdd45", "date":"2017-02-08T21:26:51" } } }

{ "error": { "code": "BadRequest", "message": "Resource not found for the segment '/users/room@xxx.com/events'.", "innerError": { "request-id": "d9ca58b1-ee1f-4072-81d5-0f1a25dcdd45", "date": "2017-02-08T21:26:51" } } }

我尝试了资源中所有类型的连击,但无法使其正常工作. 有人对此有想法吗?

I have tried all types of combos in the resource but cant get it to work. Anybody that have an idea on how to do this?

推荐答案

不需要对json属性的值进行url编码.该资源也不需要在用户"前面加上"/"(尽管这不是导致您出现问题的原因).

The value of json properties don't need to be url encoded. The resource also doesn't need a '/' in front of "users" (although this isn't what is causing your issue).

尝试将JSON更改为:

Try changing your JSON to:

{ "changeType":创建,更新,删除", "notificationUrl":" https://myurl.com/o365.php ", 资源":"users/person@myemail.com/events", "clientState":"1486588355561", "expirationDateTime":"2018-11-20T18:23:45.9356913Z" }

{ "changeType":"created,updated,deleted", "notificationUrl":"https://myurl.com/o365.php", "resource":"users/person@myemail.com/events", "clientState":"1486588355561", "expirationDateTime":"2018-11-20T18:23:45.9356913Z" }

如果不能解决问题,请随时回复.

Feel free to respond back if this doesn't address the issue.

这篇关于“找不到该段的资源";使用Graph订阅Beta的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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