As of May 30, 2024, Google made a change to the Calendar API such that my Google Script no longer works. I use Google Script to change the color of my “standard” calendar events as well as those created automatically from Gmail messages. Unfortunately, now the former cannot be updated through the Google Calendar API as every time I attempt to make an update or patch using the Advanced Calendar API, I get an error. Here is my code:
`
var eventsLocal = Calendar.Events.list(calendarId, optionalArgs)["items"];
for (var i = 0; i < eventsLocal.length; i++) {
var eventLocal = eventsLocal[i];
eventLocal.colorId = "10";
try {
eventLocal = Calendar.Events.update(
eventLocal,
calendarId,
eventLocal.id);
} catch (e) {
Logger.log('update threw an exception: ' + e);
}
}`
Here is the exception:
“API call to calendar.events.update failed with error: Bad Request”
Any help here would be appreciated!
Simple updating of color property results in exception thrown every time.