8
votes

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://docs.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

1
The URL has always been /me, not /users/me as far as I can tell.Hong Ooi
@HongOoi We are using this code in production for about two years. It just stopped working from last week. Also refer the other question stackoverflow.com/questions/55306596/…. It seems they are also facing the same issueHari Prasandh
Then you were using the wrong URL.Hong Ooi

1 Answers

4
votes

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.