如果使用 ms-graph api 授予日历委派权限,如何订阅日历事件 [英] How to subscribe calendar event if calendar is given delegated permission using ms-graph api
问题描述
Outlook 事件的更改通知可以是 创建 使用 ms graph api 订阅以下方式.
Change notifications of Outlook events can be created by subscribing following way using ms graph api .
{
"changeType": "created,updated,deleted",
"notificationUrl": "notificationUrl",
"resource": "Users/xxx169f-xxx-xxxx-afd2-936c51e6xxxx/Events",
"expirationDateTime":"2016-11-20T18:23:45.9356913Z",
"clientState": "secretClientValue"
}
但是,对于已授予委托权限的日历,我如何以类似的方式获取通知?
but how do i get notifications similar way for calendars that have given delegated permission ?
推荐答案
您可以通过将此与 Calendar.Read.Shared 一起使用来验证您可以通过 API 访问共享日历获取 https://graph.microsoft.com/v1.0/users/adelev@m365x874506.onmicrosoft.com/events
You can validate that you can access the shared calendar via API by using this with Calendar.Read.Shared GET https://graph.microsoft.com/v1.0/users/adelev@m365x874506.onmicrosoft.com/events
在本例中,AdeleV 与 MeganB 共享了她的日历.我以 Megan B 的身份登录到 Graph Explorer.https://developer.microsoft.com/en-us/graph/graph-explorer?request=users/adelev@m365x874506.onmicrosoft.com/events&method=GET&version=v1.0&GraphUrl=https://graph.microsoft.com
In this example, AdeleV has shared her calendar with MeganB. And I'm signed in as Megan B to Graph Explorer. https://developer.microsoft.com/en-us/graph/graph-explorer?request=users/adelev@m365x874506.onmicrosoft.com/events&method=GET&version=v1.0&GraphUrl=https://graph.microsoft.com
很遗憾,您无法按照此文档页面上的说明订阅事件 https://docs.microsoft.com/en-us/graph/outlook-get-shared-events-calendars?view=graph-rest-1.0
Unfortunately you cannot subscribe to events as per the note on this docs page https://docs.microsoft.com/en-us/graph/outlook-get-shared-events-calendars?view=graph-rest-1.0
注意共享权限(Calendars.Read.Shared 或 Calendars.ReadWrite.Shared)允许您在共享或委派的日历中读取或写入事件.它们不支持订阅此类文件夹中项目的更改通知.要为租户中的共享、委派或任何其他用户或资源日历中的事件设置更改通知订阅,请使用应用程序权限 Calendars.Read.
Note The sharing permissions (Calendars.Read.Shared or Calendars.ReadWrite.Shared) allow you to read or write events in a shared or delegated calendar. They do not support subscribing to change notifications on items in such folders. To set up change notification subscriptions on events in a shared, delegated, or any other user or resource calendar in the tenant, use the application permission, Calendars.Read.
这篇关于如果使用 ms-graph api 授予日历委派权限,如何订阅日历事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!