//native
/**
* Delete Calendar Event
* Delete an event, or one occurrence of a recurring event when given an occurrence id from List Event Instances. If you are the organizer, attendees get a cancellation. Requires Calendars.ReadWrite (a connection default).
*/
export async function main(auth: RT.MsOutlook, event_id: string) {
const response = await fetch(
`https://graph.microsoft.com/v1.0/me/events/${encodeURIComponent(event_id)}`,
{
method: "DELETE",
headers: {
Authorization: `Bearer ${auth.token}`,
Accept: "application/json",
},
}
)
if (!response.ok) {
throw new Error(`${response.status} ${await response.text()}`)
}
// 204 No Content
return { success: true }
}
Submitted by hugo989 2 hours ago
//native
/**
* Delete Calendar Event
* Delete an event, or one occurrence of a recurring event when given an occurrence id from List Event Instances. If you are the organizer, attendees get a cancellation. Requires Calendars.ReadWrite (a connection default).
*/
export async function main(auth: RT.Outlook, event_id: string) {
const response = await fetch(
`https://graph.microsoft.com/v1.0/me/events/${encodeURIComponent(event_id)}`,
{
method: "DELETE",
headers: {
Authorization: `Bearer ${auth.token}`,
Accept: "application/json",
},
}
)
if (!response.ok) {
throw new Error(`${response.status} ${await response.text()}`)
}
// 204 No Content
return { success: true }
}
Submitted by hugo989 11 hours ago
//native
/**
* Delete Calendar Event
* Delete an event, or one occurrence of a recurring event when given an occurrence id from List Event Instances. If you are the organizer, attendees get a cancellation. Requires Calendars.ReadWrite on the connection.
*/
export async function main(auth: RT.Outlook, event_id: string) {
const response = await fetch(
`https://graph.microsoft.com/v1.0/me/events/${encodeURIComponent(event_id)}`,
{
method: "DELETE",
headers: {
Authorization: `Bearer ${auth.token}`,
Accept: "application/json",
},
}
)
if (!response.ok) {
throw new Error(`${response.status} ${await response.text()}`)
}
// 204 No Content
return { success: true }
}
Submitted by hugo989 11 hours ago