Skip to content Skip to sidebar Skip to footer

Change Google Calendar Event Free/Busy With Calendar API

I have a GAS web app for reserving rooms. When the app creates the event, it currently defaults to 'Busy' for the event. I am trying to set the default to 'Free'. I found a GAS fo

Solution 1:

After looking around, the following seems to work. I forgot that you need to remove the "@google.com" from the event ID returned by CalendarApp before making a request to CalendarApi. The calendarId can be set to 'primary' since the user is only editing an event on their own calendar

var eventId= event_id.slice(0,event_id.length-11);
var calendarId = 'primary';
Logger.log(eventId)
var changes = {
    transparency: "transparent"
  };
Calendar.Events.patch(changes,calendarId,eventId);

Post a Comment for "Change Google Calendar Event Free/Busy With Calendar API"