Microsoft Graph - Error when subscribing to calendar notifications

跟風遠走 提交于 2019-12-11 17:49:09

问题


I was trying to set up a subscription to the notifications of one of my calendars, but am getting the following error:

{
  "error": {
    "code": "ExtensionError",
    "message": "Operation: Create; Exception: [Status Code: NotFound; Reason: Not Found]",
    "innerError": {
      "request-id": "XXXXXXXXXXX",
      "date": "2018-07-13T13:32:37"
    }
  }
}

I believe the request is correct:

{
   "changeType": "created,updated,deleted",
   "notificationUrl": "https://(...)/outlook/notifications",
   "resource": "me/calendars/{calendar_id}/events",
   "expirationDateTime":"2018-07-16T10:00:00.000Z",
   "clientState": "OutlookIntegration"
}

Any hint on what may be happening? Thanks in advance.


回答1:


You can't use /me with an application token.

Graph doesn't know what "me" is unless there is user info in the token.

You'll have to specify the user's object id or user principal name instead of "me". Like: users/object-id-here.



来源:https://stackoverflow.com/questions/51326521/microsoft-graph-error-when-subscribing-to-calendar-notifications

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!