如果使用 ms-graph api 授予日历委派权限,如何订阅日历事件
How to subscribe calendar event if calendar is given delegated permission using ms-graph api
Outlook 事件的更改通知可以created 通过使用 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"
}
但是对于已授予委派权限的日历,我如何以类似的方式获取通知?
您可以通过将此与 Calendar.Read.Shared 一起使用来验证您是否可以通过 API 访问共享日历
获取 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
很遗憾,您无法按照此文档页面上的说明订阅活动 https://docs.microsoft.com/en-us/graph/outlook-get-shared-events-calendars?view=graph-rest-1.0
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.
Outlook 事件的更改通知可以created 通过使用 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"
}
但是对于已授予委派权限的日历,我如何以类似的方式获取通知?
您可以通过将此与 Calendar.Read.Shared 一起使用来验证您是否可以通过 API 访问共享日历 获取 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
很遗憾,您无法按照此文档页面上的说明订阅活动 https://docs.microsoft.com/en-us/graph/outlook-get-shared-events-calendars?view=graph-rest-1.0
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.