Search code examples
apimicrosoft-graph-apischedulemicrosoft-graph-teamsmicrosoft-graph-calendar

Microsoft Graph API getSchedule filter by calendars


I'm using microsoft graph API and want to get user's busy slots for particular calendars, so there is an end point /getSchedule which takes body like :

{        
    "schedules": ["[email protected]", "[email protected]"],
    "startTime": {
        "dateTime": "2019-03-15T09:00:00",
        "timeZone": "Pacific Standard Time"
    },
    "endTime": {
        "dateTime": "2019-03-15T18:00:00",
        "timeZone": "Pacific Standard Time"
    },
    "availabilityViewInterval": "60"
} 

In this endpoint I want to filter by calendars, I tried passing calendarId in schedules array instead of email it's giving error of invalid email.

there is similar api provided in google calendar /freeBusy that accepts array of calendarIds and returns slots for those calendars only. I want same functionality in microsoft calendars as well, is this possible?


Solution

  • This feature only works with the main calendar of the users you're passing in (via their email address).

    As of today it's not possible to use that method with other calendars than main user's calendars, you'd have to query those calendars yourself and determine the availability time yourself.

    You can request such feature on uservoice.