Edits history of script submission #23333 for ' Delete Calendar Event (outlook)'

  • bunnative
    One script reply has been approved by the moderators
    Ap­pro­ved
    //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 6 hours ago

  • bunnative
    //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 6 hours ago