List calendars and events from users

Viewed 20

I need to read the calendars and events of two users to create an event for both users. The documentation says it should be possible.

https://learn.microsoft.com/en-gb/graph/api/calendar-get?view=graph-rest-1.0&tabs=http

GET /users/{id | userPrincipalName}/calendar

This should give me the users default calendar. I tried this on the graph explorer page (https://developer.microsoft.com/en-us/graph/graph-explorer) and i always get the same error.

{
    "error": {
        "code": "ErrorItemNotFound",
        "message": "The specified object was not found in the store.",
        "innerError": {
            "date": "2022-09-22T06:40:48",
            "request-id": "cc36cb73-348a-4062-a07b-70cf4617e7cc",
            "client-request-id": "6932f760-f6b2-5d40-5350-c380917725f2"
        }
    }
}

I get the same error with calendars, which should give me all calendars. Without the calendar i retrieve the user details, so the id is ok. Any idea or hint why it is not working?

1 Answers
Related