无法使用 Office365 日历 API 获取会议室的所有繁忙时间 [英] Can't get all busy times of meeting rooms using the Office365 Calendar API

查看:101
本文介绍了无法使用 Office365 日历 API 获取会议室的所有繁忙时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试获取日历事件以允许用户选择与会者和会议室可用的会议时间.

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.

我们使用的是 Outlook 日历 REST API v2 - findMeetingTimes:https://msdn.microsoft.com/en-us/office/office365/api/calendar-rest-operations#FindMeetingTimes

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('user@companyname.onmicrosoft.com')/findmeetingtimes

{
    "Attendees": [{
        "Type": "Required",
        "EmailAddress": {
            "Name": "Palo Alto meeting room",
            "Address": "paloalto@companyname.onmicrosoft.com"
        }
    }],
    "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": "paloalto@companyname.onmicrosoft.com"
        }]
    },
    "MinimumAttendeePercentage": "0",
    "MaxCandidates": "1000",
    "ReturnSuggestionReasons": "true"
}

任何帮助将不胜感激.

推荐答案

好的,澄清一下,这是我一开始错过的关键点:您遇到的问题是经过身份验证的用户预订的约会使用会议室作为位置不会导致在 FindMeetingTimes 响应中显示条目.(起初我以为你是说它显示为 Free!)

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!)

这是正确的行为.FindMeetingTimes 并不是要返回一个详尽的忙/闲结果列表.而是寻找潜在的见面时间!该列表基于组织者(经过身份验证的用户)和指定与会者的可用性.因为组织者和房间都很忙(因为组织者已经在房间里预订了约会),甚至没有显示时间段.当您以其他用户的身份提出请求时,他们是组织者,并且由于他们当时有空,所以该时段显示为可能的时间.

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.

这篇关于无法使用 Office365 日历 API 获取会议室的所有繁忙时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆