Ray Perry
Ray Perry

Reputation: 83

Google Calendar ignoring ICS UID when using "Add to Calendar" link

Developing an app where applicants schedule interviews with our team members through a third party service. Periodically we make API calls to the third party for any recent changes, generate an ICS file then email that file to our team member so they can store it in their Google Calendar.

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Google Inc//Google Calendar 70.9054//EN
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VEVENT
DTSTART:20171001T180000Z
DTEND:20171001T190000Z
SUMMARY:Sample Event
UID:[email protected]
DTSTAMP:20171001T023000Z
ORGANIZER:[email protected]
SEQUENCE:0
END:VEVENT
END:VCALENDAR

The issue I'm having is that when the team member clicks the "Add to Calendar" link that Google Mail generates. It ignores the UID I generated, [email protected], and creates it's own: [email protected].

Because of this, when updates are made to the event the UID is not the same as Google is storing, therefore it creates a whole new event rather than updating the existing event. In the example below the event was moved 1 hour ahead:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Google Inc//Google Calendar 70.9054//EN
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VEVENT
DTSTART:20171001T190000Z
DTEND:20171001T200000Z
SUMMARY:Sample Event
UID:[email protected]
DTSTAMP:20171001T023224Z
ORGANIZER:[email protected]
SEQUENCE:1
END:VEVENT
END:VCALENDAR

So now there are two events for the same interview with two different [email protected] UIDs.

I have found that if I import the ICS file directly, instead of using the "Add to Calendar" link, then the UID is preserved as originally created and updating/cancelling works as expected. Since the process of importing events in Google Calendar isn't the easiest workflow and the large volume of events we're expecting, I'm hoping to retain the "Add to Calendar" method.

Any suggestions on what I'm doing wrong here?

Upvotes: 1

Views: 3396

Answers (1)

Arnaud Quillaud
Arnaud Quillaud

Reputation: 4645

You are sending a meeting REQUEST without any ATTENDEE property. ATTENDEE is mandatory as per https://www.rfc-editor.org/rfc/rfc5546#section-3.2.2 This is the most likely cause of the calendar server being confused.

Upvotes: 1

Related Questions