且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

了解 Microsoft graph/getSchedule Api 功能

更新时间:2023-11-22 14:55:52

文档说:

表示响应中可用性视图中的时隙持续时间.默认为 30 分钟,最小值为 5,最大值为 1440.可选.

Represents the duration of a time slot in an availabilityView in the response. The default is 30 minutes, minimum is 5, maximum is 1440. Optional.

这表示availabilityView 中的时隙大小.看一个例子可能会有所帮助.

What this signifies are the size of a time slot in the availabilityView. It's probably helpful to look at an example.

这是来自文档的示例请求:

Here's the sample request from the doc:

{        
    "schedules": ["adelev@contoso.onmicrosoft.com", "meganb@contoso.onmicrosoft.com"],
    "startTime": {
        "dateTime": "2019-03-15T09:00:00",
        "timeZone": "Pacific Standard Time"
    },
    "endTime": {
        "dateTime": "2019-03-15T18:00:00",
        "timeZone": "Pacific Standard Time"
    },
    "availabilityViewInterval": 60
}

availabilityViewInterval 设置为 60,这意味着返回的 availabilityView 中的每个数字代表 60 分钟的时间块.示例响应显示了 Megan 的值 200220010.0 = 空闲,1 = 暂定,2 = 忙碌,我们可以将其解码为:

With availabilityViewInterval set to 60, that means each numeral in the returned availabilityView represents a 60 minute chunk of time. The sample response shows the value 200220010 for Megan. With 0 = free, 1 = tentative, and 2 = busy, we can decode this as:

  • 上午 9 点 - 上午 10 点忙
  • 上午 10 点 - 上午 11 点免费
  • 上午 11 点至下午 12 点免费
  • 12PM - 1PM 忙
  • 下午 1 点 - 下午 2 点忙
  • 下午 2 点 - 下午 3 点免费
  • 下午 3 点 - 下午 4 点免费
  • 下午 4 点 - 下午 5 点(暂定)
  • 下午 5 点 - 下午 6 点免费

如果您在 availabilityViewInterval 设置为 30 的情况下执行相同的请求,您将返回 220000222200001100availabilityView 值,每个数字代表一段 30 分钟的时间.

If you did this same request with availabilityViewInterval set to 30, you'd get back an availabilityView value of 220000222200001100, each digit representing a 30 minute chunk of time.