Microsoft Graph - Difference between calls

Viewed 59

I have tried to go through the documentation but didnt get a clear idea about difference in below calls:

GET users/{id | userPrincipalName}/events
GET users/{id | userPrincipalName}/calendar/events
GET users/{id | userPrincipalName}/calendar/{calendarId}/events

I did query them separately and they are returning same number of results. Which one is most efficient to use and in what scenarios each one of them is used.

1 Answers

To retrieve a list of events in a user's all calendars you can use

GET users/{id | userPrincipalName}/events

To retrieve a list of events in a user's default calendar you can use

GET users/{id | userPrincipalName}/calendar/events

To retrieve a list of events in a user's specific calendar in the default calendarGroup.

GET users/{id | userPrincipalName}/calendar/{calendarId}/events

First endpoint will return more results than second and third endpoint.

If all endpoints return the same number of results then it means that you have only one calendar.

Related