microsoft-graph-apimicrosoft-graph-sdksmicrosoft-graph-calendar

Is it possible to get all events from all calendars regardless of calendar group


I want to use a Graph request to pull all events from all calendars regardless of a calendar group. What I have tried:

GET /me/calendar/events
GET /me/calendarGroups/{id}/calendars/{id}/events

Case one I get from one calendar from the default calendar. case two I get from a specific calendar in any group. Any way of getting events from all calendars everywhere?


Solution

  • To get all events from all user's calendars you can use Client Credential flow which gives App only token and use it to query all calendars using below call

    https://graph.microsoft.com/v1.0/users/userid/calendars

    and then use the calendarid's and pull the events by using the below call for each calendar_id.

    https://graph.microsoft.com/v1.0/users/1ab4e76f-5f52-44b8-8a72-7d03c05e6ff4/calendars/AAMkAGI0Mjk2NTQ5LTE4MjctNDE1Yy04Nzc0LWIxNzA0MDBkNDkwZABGAAAAAABAJhtsoNeXR49KeByGVNbsBwB0tR3-uC1cSqrKkE00IGLeAAAAAAEGAAB0tR3-uC1cSqrKkE00IGLeAAAAAB89AAA=/events

    There is no direct call to get all events from all the calendars as of now. There is already a feature request raised in the Microsoft Graph Feature Request Forum, please upvote it so that it may be implemented in the future.