Вы можете использовать /getSchedule
, чтобы проверить, доступен ли пользователь / занят.Если у вас много пользователей, вам нужно проверить по одному.
Запрос :
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
и /findMeetingTimes
: Чем getSchedule отличается от findMeetingTimes