使用 Microsoft Graph 可以检查用户是否在 Outlook 日历中 available/busy

Using using microsoft graph is possible to check if an user is available/busy in the outlook calendar

我正在使用 /findMeetingTimes post 请求来检查用户是否可以使用 Microsoft Graph。我想知道是否还有其他方法可以获取用户可用性?

这是我正在使用的调用示例:

请求(POST):

https://graph.microsoft.com/beta/me/findMeetingTimes

正文:

{
  "attendees": [
    {
      "emailAddress": {
        "address": "ricardo.guerrero@email",
        "name": "Ricardo Guerrero Matus"
      },
      "type": "Required"
    }
  ],
  "timeConstraint": {
    "ActivityDomain": "Work",
    "timeslots": [
      {
        "start": {
          "dateTime": "2018-10-05T13:00:00.000Z",
          "timeZone": "Central Standard Time"
        },
        "end": {
          "dateTime": "2018-10-05T14:00:00.000Z",
          "timeZone": "Central Standard Time"
        }
      }
    ]
  },
  "MeetingDuration": "PT1H"
}

您可以使用 /getSchedule 检查用户是否 available/busy。如果你有很多用户,你需要一个一个地检查。

请求:

 POST https://graph.microsoft.com/beta/me/calendar/getschedule  
 Prefer: outlook.timezone="Pacific Standard Time" 
 Content-Type: application/json

{
  "Schedules": ["AlexW@contoso.OnMicrosoft.com"],
  "StartTime": {
    "dateTime": "2018-08-06T09:00:00",
    "timeZone": "Pacific Standard Time"
  },
  "EndTime": {
    "dateTime": "2018-08-06T18:00:00",
    "timeZone": "Pacific Standard Time"
  },
  "availabilityViewInterval": "15"
}

回应:

 HTTP/1.1 200 OK 
 Content-type: application/json

 {
  "@odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(microsoft.graph.scheduleInformation)",
  "value": [
    {
      "scheduleId": "AlexW@contoso.OnMicrosoft.com",
      "availabilityView": "111111002222222200000000000000000000",
      "scheduleItems": [
        {
          "isPrivate": false,
          "status": "Tentative",
          "start": {
            "dateTime": "2018-08-06T09:00:00.0000000",
            "timeZone": "Pacific Standard Time"
          },
          "end": {
            "dateTime": "2018-08-06T10:30:00.0000000",
            "timeZone": "Pacific Standard Time"
          }
        },
        {
          "isPrivate": false,
          "status": "Busy",
          "start": {
            "dateTime": "2018-08-06T11:00:00.0000000",
            "timeZone": "Pacific Standard Time"
          },
          "end": {
            "dateTime": "2018-08-06T13:00:00.0000000",
            "timeZone": "Pacific Standard Time"
          }
        }
      ],
      "workingHours": {
        "daysOfWeek": ["monday", "tuesday", "wednesday", "thursday", "friday"],
        "startTime": "08:00:00.0000000",
        "endTime": "17:00:00.0000000",
        "timeZone": {
          "@odata.type": "#microsoft.graph.customTimeZone",
          "bias": 480,
          "name": "Customized Time Zone",
          "standardOffset": {
            "time": "02:00:00.0000000",
            "dayOccurrence": 1,
            "dayOfWeek": "sunday",
            "month": 11,
            "year": 0
          },
          "daylightOffset": {
            "daylightBias": -60,
            "time": "02:00:00.0000000",
            "dayOccurrence": 2,
            "dayOfWeek": "sunday",
            "month": 3,
            "year": 0
          }
        }
      }
    }
  ]
}

比较/getSchedule/findMeetingTimesHow is getSchedule different from findMeetingTimes