1

I have to change the google calendar notification time from 30 minutes to 5 minutes.

const encodedUrl = encodeURI(
    [
      "https://www.google.com/calendar/render",
      "?action=TEMPLATE",
      `&text=${calendarEvent.title || ""}`,
      `&dates=${startDate || ""}`,
      `/${endDate || ""}`,
      `&add=elf1@example.com,elf2@example.com`,
      // TODO: append video appointment link to description
      `&details=${`${calendarEvent.description}\n` || ""}`,
      `&location=${calendarEvent.address || ""}`,
      "&sprop=&sprop=name:"
    ].join("")
  );

With the above URL string, I can set the event title, event timing, and event location parameters except for the notification time. But now I want to update the notification time in the calendar event in the above link, Is that possible?

enter image description here

1 Answers1

1

The Events resource from Calendar API includes a reminders property, which can be used to manage event notifications.

Therefore, you can update the event notifications via Events: patch or Events: update by adding the reminders property to your payload.

For example, if you were calling this API on Google Apps Script, you would do something like this:

const resource = {
  reminders: {
    overrides: [
      {
        method: "popup", // options: "popup", "email"
        minutes: 5
      }
    ]
  }
}
Calendar.Events.patch(resource, calendarId, eventId);

If you need more information about how to use Calendar API, take a look at the different quickstarts available, for example this one for JavaScript.

Reference:

Iamblichus
  • 18,540
  • 2
  • 11
  • 27
  • Can you also look into this [question](https://stackoverflow.com/questions/75374684/how-to-create-google-resource-calendar-using-any-api)? – Benyamin Jafari Feb 13 '23 at 09:47
  • And [this one](https://stackoverflow.com/questions/74755419/why-does-it-turn-into-an-unavailable-room-when-i-create-a-google-resource-calend) please – Benyamin Jafari Feb 13 '23 at 11:37