Search code examples
c#apioffice365microsoft-graph-apimicrosoft-graph-calendar

How to get Office 365 calendar event by time and location using Graph API?


When I create a new event for a location, I need to check whether that location is busy and if it is, I need to send an email to existing event's creator that their event is going to be double booked. First, I use calendar/getSchedule API call to get a schedule for the location(room) for given timeframe. That returns me the array of busy times for that room, but doesn't give me any extra information about the actual events or event creators.

Knowing the tie frame and location of an event (e.g. 2-3pm at War Room) how to I retrieve that particular event using Graph API (either REST or .NET SDK)?


Solution

  • user:calendar:calendarView endpoint returns all the events for the user and given timeframe