8

We use Microsoft Graph API's to create a calendar in outlook

Following is the HTTP Request

POST https://graph.microsoft.com/v1.0/users/me/calendars
Content-type: application/json

{
  "name": "My Calendar"
}

It was working for the last 2 years. Suddenly it is throwing an error as

{
  "error": {
    "code": "TargetIdShouldNotBeMeOrWhitespace",
    "message": "Id is malformed.",
    "innerError": {
      "request-id": "78bce863-d6fb-4ea9-b0f8-e5097010cef6",
      "date": "2019-03-23T11:54:34"
    }
  }
}

When we searched the documentation (https://learn.microsoft.com/en-us/graph/api/user-post-calendars?view=graph-rest-1.0). We found the API URL has been changed

  1. When was a critical update like this was rolled out which caused breakage in our flows?

  2. Is there any official channel/group notifying these changes.

similar question for mail API's Microsoft Graph API - SendMail http 400 - API url from documentation not working

bugfreerammohan
  • 1,471
  • 1
  • 7
  • 22
Hari Prasandh
  • 467
  • 2
  • 13
  • The URL has always been `/me`, not `/users/me` as far as I can tell. – Hong Ooi Mar 25 '19 at 07:34
  • @HongOoi We are using this code in production for about two years. It just stopped working from last week. Also refer the other question https://stackoverflow.com/questions/55306596/microsoft-graph-api-sendmail-http-400-api-url-from-documentation-not-working. It seems they are also facing the same issue – Hari Prasandh Mar 25 '19 at 07:37
  • Then you were using the wrong URL. – Hong Ooi Mar 25 '19 at 07:38

1 Answers1

5

The correct URI is /me, not /users/me. Behind the scenes, /me is just an alias for /users/{id}. Asking for /users/me would be the equivalent of asking for /users/users/me.

It sounds like you were making use of an unintended behavior. It stopped working when that behavior was corrected.

Marc LaFleur
  • 31,987
  • 4
  • 37
  • 63