Google Calendar changing ID

160 views
Skip to first unread message

Federico Granata

unread,
Mar 24, 2019, 3:08:45 PM3/24/19
to Google Apps Script Community
Hi, I'm not sure this is the right place but I just made an uncanny discovery.
I have a very old App Script (we're talking about 7-ish years old) that looks at the "Contacts" calendar for birthdays appening today and in the next 7 days and sends me an email as a reminder.

It worked fine since I wrote it but since a couple days it  stopped. Right now I had the time to investigate and I just discovered that this calendar changed it's ID from "#cont...@group.v.calendar.google.com" to "addressbook#cont...@group.v.calendar.google.com" breaking my script.

Besides the issue itself of a calendar changing its own ID (maybe it's related to the sunset of G+) I'm more concerned about how to manage this issue in a script.

Since now I simply do var contactsEvents=CalendarApp.getCalendarById('addressbook#cont...@group.v.calendar.google.com').getEvents(start, end); because I thought that an ID is, very like a diamond, forever.
Now I changed this line to retrieve the calendar and to manage the error if the calendar isn't found but I'm wondering if this is a "one time only" event or something that could happen even with my own calendar.

Romain Vialard

unread,
Mar 25, 2019, 5:57:06 AM3/25/19
to Google Apps Script Community
Indeed I suppose that's related to the sunset of G+:

Maybe they didn't change the ID but deleted the old calendar and created a new one ? (showing only birthdays related to your Google Contacts and not birthdays of your G+ connections).

Federico Granata

unread,
Mar 25, 2019, 9:22:27 AM3/25/19
to Google Apps Script Community
This is even messier ... It means that they add a calendar without user permission ... 
Reply all
Reply to author
Forward
0 new messages