1

Delete Event

by
Published Jul 26, 2022
Script gcal Verified

The script

Submitted by hugo989 Typescript (fetch-only)
Verified 7 days ago
1
//native
2

3
type Gcal = {
4
  token: string;
5
};
6
export async function main(
7
  gcal_auth: Gcal,
8
  calendarId: string,
9
  eventId: string,
10
) {
11
  const sendUpdates = "all";
12

13
  const DELETE_EVENT_URL = `https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events/${eventId}/?sendUpdates=${sendUpdates}`;
14

15
  const token = gcal_auth["token"];
16

17
  const response = await fetch(DELETE_EVENT_URL, {
18
    method: "DELETE",
19
    headers: {
20
      Authorization: "Bearer " + token,
21
      "Content-Type": "application/json",
22
    },
23
  });
24

25
  return response;
26
}
27

Other submissions
  • Submitted by rossmccrann Deno
    Created 399 days ago
    1
    type Gcal = {
    2
      token: string;
    3
    };
    4
    export async function main(
    5
      gcal_auth: Gcal,
    6
      calendarId: string,
    7
      eventId: string,
    8
    ) {
    9
      const sendUpdates = "all";
    10
    
    
    11
      const DELETE_EVENT_URL = `https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events/${eventId}/?sendUpdates=${sendUpdates}`;
    12
    
    
    13
      const token = gcal_auth["token"];
    14
    
    
    15
      const response = await fetch(DELETE_EVENT_URL, {
    16
        method: "DELETE",
    17
        headers: {
    18
          Authorization: "Bearer " + token,
    19
          "Content-Type": "application/json",
    20
        },
    21
      });
    22
    
    
    23
      return response;
    24
    }
    25