Skip to content

Instantly share code, notes, and snippets.

@tanaikech
Created Jan 9, 2020
Embed
What would you like to do?
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