我目前正在开发Microsoft Graph和我的Web应用程序之间的日历同步。
我们的一位客户使用Ofice,因此内部使用邮件和日历数据。我们进行了一些研究,发现this document描述了通过Microsoft Graph启用Hybrid API访问的必要步骤。正如Microsoft documentation中所引用的那样,此方法非常好用和简单。
我的问题是我无法创建本地日历的订阅。我可以使用这样的API来访问它们
GET https://graph.microsoft.com/v1.0/me/calendars/{CALENDARID}/events
或使用
获取日历列表本身GET https://graph.microsoft.com/v1.0/me/calendars
创建订阅时使用的
POST https://graph.microsoft.com/v1.0/subscriptions
有效载荷:
{
"expirationDateTime": "2018-12-05T12:26:35.908636Z",
"notificationUrl": "https://myworkingand200returningurl", // tested and working
"resource": "me/calendars/{calendarID}/events",
"changeType": "created, updated, deleted"
}
这将使我得到如下信息:
{
"error": {
"code": "ExtensionError",
"message": "Operation: Create; Exception: [Status Code: NotFound; Reason: Not Found]",
"innerError": {
"request-id": "32a5fa29-8863-4bd1-9e98-4028d231429b",
"date": "2018-12-04T13:52:17"
}
}
}
我还尝试使用显式的用户名和用户ID代替me
作为导致相同结果的资源。如果未运行本地环境的用户使用相同的API,则相同的调用似乎可以正常工作。