Skip to content

Instantly share code, notes, and snippets.

@TheGreatGaspy
Forked from tanaikech/submit.md
Created September 24, 2023 13:02
Show Gist options
  • Save TheGreatGaspy/739d31f0160c82e87fa79d4749469f68 to your computer and use it in GitHub Desktop.
Save TheGreatGaspy/739d31f0160c82e87fa79d4749469f68 to your computer and use it in GitHub Desktop.
Retrieving Event ID from Event URL of Google Calendar using Google Apps Script

Retrieving Event ID from Event URL of Google Calendar using Google Apps Script

This is a sample script for retrieving the event ID from the event URL of Google Calendar using Google Apps Script.

The event URL is like https://www.google.com/calendar/event?###. At the event URL, ### of https://www.google.com/calendar/event?### is not the event ID. So it is required to convert it.

Sample script

var eventUrl = "https://www.google.com/calendar/event?###";
var eventId = Utilities.newBlob(Utilities.base64Decode(eventUrl.split("=")[1]))
  .getDataAsString()
  .split(" ")[0];
Logger.log(eventId);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment