Can't get all busy times of meeting rooms using the Office365 Calendar API
Asked Answered
S

1

0

Trying to fetch calendar events in order to allow a user to pick a time for a meeting where the attendees and the meeting room are available.

We're using Outlook Calendar REST API v2 - findMeetingTimes: https://msdn.microsoft.com/en-us/office/office365/api/calendar-rest-operations#FindMeetingTimes

The request returns almost all of the events. For some reason events that were created by the user that executes the request are not included in the response. It means that the meeting room or attendee seem as FREE even though they have an event in their calendar.

Here's a sample request with only the meeting room as attendee. We see the same problematic behavior when requesting events for both meeting rooms and users.

https://outlook.office.com/api/v2.0/users('[email protected]')/findmeetingtimes

{
    "Attendees": [{
        "Type": "Required",
        "EmailAddress": {
            "Name": "Palo Alto meeting room",
            "Address": "[email protected]"
        }
    }],
    "TimeConstraint": {
        "Timeslots": [{
            "Start": {
                "DateTime": "2017-02-11T22:00:00",
                "TimeZone": "GMT Standard Time"
            },
            "End": {
                "DateTime": "2017-04-29T20:59:59",
                "TimeZone": "GMT Standard Time"
            }
        }]
    },
    "LocationConstraint": {
        "IsRequired": "false",
        "SuggestLocation": "false",
        "Locations": [{
            "ResolveAvailability": "false",
            "DisplayName": "Palo Alto meeting room",
            "LocationEmailAddress": "[email protected]"
        }]
    },
    "MinimumAttendeePercentage": "0",
    "MaxCandidates": "1000",
    "ReturnSuggestionReasons": "true"
}

Any help will be much appreciated.

Sock answered 26/2, 2017 at 9:32 Comment(2)
I wasn't able to reproduce this behavior with a conference room, so I'm thinking that maybe there's a detail missing here. How does the user create the event on the conference room's calendar? Just for clarity: I logged in to OWA with my user, created an event on my calendar (for 10AM-11AM PST), and added the conf room as the location. I got back the acceptance from the conf room calendar. I then made the API request as that same user, with my time constraint between 9AM and 12PM on the same day. I did not get back any available slots between 10AM and 11AM, as expected.Isisiskenderun
@JasonJohnston Thanks for looking into this! I'll clarify. When another user creates an event with the conf room as location, then the time of the event is returned as busy. But when the same user that created the event requests the availability of the meeting room, it is not returned as neither free nor busy, it is just missing. We would like to show when the room is busy and this information is missing. Hope it's clear.Sock
I
1

Ok, so to clarify, and this is the key point I missed at first: the problem that you're having is that the appointment booked by the authenticated user using the conference room as a location does NOT cause an entry to show up in the FindMeetingTimes response. (At first I thought you were saying it was showing as Free!)

This is correct behavior. FindMeetingTimes is not meant to return an exhaustive list of free/busy results. Rather, it's to find a potential meeting time! The list is based on the availability of the organizer (the authenticated user) and the specified attendees. Because both the organizer AND the room are busy (because the organizer has an appointment already booked in the room), the time slot isn't even presented. When you make the request as another user, they are the organizer, and since they are free at that time, the slot is presented as a possible time.

So I may misunderstand what you're trying to do, but this should work for you. As long as you're only presenting the times returned as possibilities, there isn't a potential for conflict.

Isisiskenderun answered 28/2, 2017 at 17:24 Comment(1)
Right, and even more so, even if the user has created an event for the conf room that includes other attendees, and the user is free at that time, the conf room will not show as either free nor busy, just missing. This behavior is confusing since it only happens at this particular case, and somewhat disappointing since if it were to return the busy events in this case the API could allow us to show the BUSY times as well, allowing for a richer functionality. In any case, I do understand that the API is intended for presenting the FREE times only. Thanks so much for your help!Sock

© 2022 - 2024 — McMap. All rights reserved.