Search code examples
microsoft-graph-apimicrosoft-graph-calendar

Microsoft Graph - FindMeetingTimes API error?


I am seeing issues with the Graph API method findMeetingTimes.

As you can see from the attached file the API response differs depending on the start time. When using flat times like 12:00 the response includes only flat times - while when using non-flat times like 12:15 it only includes 'half-hour times'.

enter image description here) So to get all possible meeting times I would have to make at least two API calls, which doesn't seem very practical.

Is there something I am missing ?

Thanks in advance,
Jacky


Solution

  • No, you are not missing anything. You'll need to call the API more than once to get suggestions with overlapping times.

    The API returns the nearest available time to the start time specified in the request. The suggestions will always be on the hour or at half past.

    Thereafter, it will give suggestions with increments of 30 minutes, or value specified in the meetingDuration property from the first suggestion, without overlaps.

    If you had set your start time to say, 12:15 and the first available time is 13:00 and meeting duration is 1h, all suggestions will be on the hour. The same applies if you'd set the start time to 12:00 and the first available time is at 12:30, all suggestions will be at half past.

    You can add the returnSuggestionReasons property in your request which gives an explanation on why a particular time was suggested.

    {
        "timeConstraint": {
            "activityDomain": "unrestricted",
            "timeSlots": [
                {
                    "start": {
                        "dateTime": "2021-05-24T12:00:00",
                        "timeZone": "UTC"
                    },
                    "end": {
                        "dateTime": "2021-05-24T18:00:00",
                        "timeZone": "UTC"
                    }
                }
            ]
        },
        "meetingDuration": "PT30MIN",
        "returnSuggestionReasons": "true"
    }