Skip to content

Instantly share code, notes, and snippets.

@tanaikech
Created January 9, 2020 05:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tanaikech/b366be5995be04f689c3d80b18363f5e to your computer and use it in GitHub Desktop.
Save tanaikech/b366be5995be04f689c3d80b18363f5e 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