//native
/**
* Get Free/Busy Schedule
* Get the free/busy availability of users, distribution lists or rooms (by email address) over a window of local times in `time_zone`. Requires Calendars.Read (covered by the default Calendars.ReadWrite).
*/
export async function main(
auth: RT.MsOutlook,
schedules: string[],
start: string,
end: string,
time_zone: string = "UTC",
availability_view_interval: number = 30
) {
const response = await fetch(
"https://graph.microsoft.com/v1.0/me/calendar/getSchedule",
{
method: "POST",
headers: {
Authorization: `Bearer ${auth.token}`,
"Content-Type": "application/json",
Accept: "application/json",
Prefer: `outlook.timezone="${time_zone}"`,
},
body: JSON.stringify({
schedules,
startTime: { dateTime: start, timeZone: time_zone },
endTime: { dateTime: end, timeZone: time_zone },
availabilityViewInterval: availability_view_interval,
}),
}
)
if (!response.ok) {
throw new Error(`${response.status} ${await response.text()}`)
}
return await response.json()
}
Submitted by hugo989 2 hours ago
//native
/**
* Get Free/Busy Schedule
* Get the free/busy availability of users, distribution lists or rooms (by email address) over a window of local times in `time_zone`. Requires Calendars.Read (covered by the default Calendars.ReadWrite).
*/
export async function main(
auth: RT.Outlook,
schedules: string[],
start: string,
end: string,
time_zone: string = "UTC",
availability_view_interval: number = 30
) {
const response = await fetch(
"https://graph.microsoft.com/v1.0/me/calendar/getSchedule",
{
method: "POST",
headers: {
Authorization: `Bearer ${auth.token}`,
"Content-Type": "application/json",
Accept: "application/json",
Prefer: `outlook.timezone="${time_zone}"`,
},
body: JSON.stringify({
schedules,
startTime: { dateTime: start, timeZone: time_zone },
endTime: { dateTime: end, timeZone: time_zone },
availabilityViewInterval: availability_view_interval,
}),
}
)
if (!response.ok) {
throw new Error(`${response.status} ${await response.text()}`)
}
return await response.json()
}
Submitted by hugo989 11 hours ago
//native
/**
* Get Free/Busy Schedule
* Get the free/busy availability of users, distribution lists or rooms (by email address) over a window of local times in `time_zone`. Requires Calendars.Read on the connection.
*/
export async function main(
auth: RT.Outlook,
schedules: string[],
start: string,
end: string,
time_zone: string = "UTC",
availability_view_interval: number = 30
) {
const response = await fetch(
"https://graph.microsoft.com/v1.0/me/calendar/getSchedule",
{
method: "POST",
headers: {
Authorization: `Bearer ${auth.token}`,
"Content-Type": "application/json",
Accept: "application/json",
Prefer: `outlook.timezone="${time_zone}"`,
},
body: JSON.stringify({
schedules,
startTime: { dateTime: start, timeZone: time_zone },
endTime: { dateTime: end, timeZone: time_zone },
availabilityViewInterval: availability_view_interval,
}),
}
)
if (!response.ok) {
throw new Error(`${response.status} ${await response.text()}`)
}
return await response.json()
}
Submitted by hugo989 11 hours ago