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

查看:124
本文介绍了使用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 Calendar REST API v2-findMeetingTimes: https://msdn.microsoft.com/zh-cn/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天全站免登陆