Ghelthon
Ghelthon

Reputation: 55

Microsoft Graph - Error when subscribing to calendar notifications

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.

Upvotes: 0

Views: 385

Answers (1)

juunas
juunas

Reputation: 58723

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.

Upvotes: 2

Related Questions