Search code examples
javascripturleventsgoogle-calendar-api

How do I create/change a Google Calendar Event with a given Meet URL using Google Apps Script?


I'm trying to create or update a Google Calendar Event using a previously generated Meet URL. I've tried with something like this:

  var event = eventCal.createEvent(summary, startTime, endTime, options);      
  var eventId = event.getId().split("@")[0];

  var event1 = Calendar.Events.get(calendarId, eventId);
  event1.setHangoutLink(room); //OLD Meet URL
  Calendar.Events.update(event1, calendarId, event1.id);
  var room1 = event1.hangoutLink;

Everything seems to be fine, from the last row I obtain that room1 == room, but the Event gets created with a new Meet URL! The one I get adding:

  var newRoom = Calendar.Events.get(calendarId, eventId).hangoutLink;

after the previous code. I also tried .patch() with the same result. Any hint?


Solution

  • Unfortunately this is currently not possible

    Indeed, the documentation for the event resource specifies:

    hangoutLink
    An absolute link to the Google+ hangout associated with this event. Read-only.

    On Google's Issue Tracker there is already a feature request for implementing the manual setting of the Hangout link. I recommen you to "star" the issue to increase the visibility and receive notifications about the implementaiton of the feature.