2

Our application programmatically spits out an .ics file for events. This is what the initial .ics file that gets emailed out looks like, when an event is originally confirmed:

BEGIN:VCALENDAR
BEGIN:VTIMEZONE
METHOD:REQUEST
TZID:America/New_York
TZURL:http://tzurl.org/zoneinfo-outlook/America/New_York
X-LIC-LOCATION:America/New_York
END:VTIMEZONE
BEGIN:VEVENT
UID:test-7-oct-24-2016-uid
DTSTAMP:20161024T181901
ORGANIZER;CN=Host:mailto:fake1@email.com
ATTENDEE;CN=Guest:mailto:fake2@email.com
DTSTART;TZID=America/New_York:20170103T073000
DTEND;TZID=America/New_York:20170103T093000
SUMMARY:Insert random summary
GEO:0;0
DESCRIPTION:Random event
LOCATION:Random Location
SEQUENCE: 0
STATUS: CONFIRMED
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR

This also seems to randomly prompt a menu on Apple's calendar whether or not I want to add the event to my calendar. Sometimes it shows that prompt, other times it doesn't. Not exactly sure why that is.

Anyway, we then send out the 2nd .ics file when the event is cancelled:

BEGIN:VCALENDAR
BEGIN:VTIMEZONE
METHOD:CANCEL
TZID:America/New_York
TZURL:http://tzurl.org/zoneinfo-outlook/America/New_York
X-LIC-LOCATION:America/New_York
END:VTIMEZONE
BEGIN:VEVENT
UID:test-7-oct-24-2016-uid
DTSTAMP:20161024T181901
ORGANIZER;CN=Host:mailto:fake1@email.com
ATTENDEE;CN=Guest:mailto:fake2@email.com
DTSTART;TZID=America/New_York:20170103T073000
DTEND;TZID=America/New_York:20170103T093000
SUMMARY:Insert random summary
GEO:0;0
DESCRIPTION:Random event
LOCATION:Random Location
SEQUENCE: 1
STATUS: CANCELLED
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR

This doesn't end up cancelling the event in my calendar app. Not sure what's going on here. Does anyone know where I'm going wrong in this ics file?

roonie
  • 763
  • 1
  • 9
  • 15

3 Answers3

2

Your METHOD property which indicates the type of iTIP message is included in the VTIMEZONE definition so it probably ends up being totally ignored by the client. The METHOD should appear before the VTIMEZONE.

In other words, you should have:

BEGIN:VCALENDAR
METHOD:REQUEST
BEGIN:VTIMEZONE
...

instead of

BEGIN:VCALENDAR
BEGIN:VTIMEZONE
METHOD:REQUEST
...

This is also true for your CANCEL.

There might be other issues of course.

Arnaud Quillaud
  • 4,420
  • 1
  • 12
  • 8
  • I am getting file not supported error when placed `METHOD:CANCEL` just above `BEGIN:VTIMEZONE`. However error not appear when placed after `END:VTIMEZONE` but event not cancelled in outlook web. – vineeth sivan Apr 12 '17 at 12:12
  • Above solution didn't work for me. Basically, if you want to cancel\delete the event with ICS file use METHOD:CANCEL. – Invincible Sep 10 '18 at 15:15
  • when i put METHOD:CANCEL my show me file corrupted look https://prnt.sc/ss5493 and https://prnt.sc/ss55lk – kuldeep chopra Jun 02 '20 at 06:46
1

I had difficulties with google mail (gmail) when tried to cancel calendar event via ics file. Digging in documentation and testing several different scenarios eventually gave me right format for invitation/cancel invitation files. Here is my working examples:

invitation.ics

BEGIN:VCALENDAR
VERSION:2.0
PRODID:Calendar Event
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VEVENT
DTSTART:20230606T084500Z
DTEND:20230606T090000Z
DTSTAMP:20230526T181133Z
ORGANIZER;CN=some.com:mailto:no-reply@somemail.com
UID:MTQyODk=
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;RSVP=TRUE;CN=some name;X-NUM-GUESTS=0:someemail@mailinator.com
CREATED:20230526T181133Z
DESCRIPTION:some desciption
LAST-MODIFIED:20230526T181133Z
LOCATION:10400 ROOSEVELT AVENUE
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:some summary
TRANSP:OPAQUE
X-APPLE-TRAVEL-ADVISORY-BEHAVIOR:AUTOMATIC
BEGIN:VALARM
TRIGGER:-PT6H
ACTION:EMAIL
DESCRIPTION:some desciption
END:VALARM
END:VEVENT
END:VCALENDAR

cancellation.ics:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:Calendar Event
METHOD:CANCEL
BEGIN:VEVENT
UID:MTQyODk=
DTSTAMP:20230526T181304Z
SEQUENCE:1
STATUS:CANCELLED
ORGANIZER;CN=some:mailto:no-reply@some.com
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;RSVP=TRUE;CN=some name;X-NUM-GUESTS=0:some@mailinator.com
SUMMARY:summary here
DTSTART:20230606T084500Z
DTEND:20230606T090000Z
END:VEVENT
END:VCALENDAR

Here are several important things:

  1. uid for both invitation/cancellation.ics should be the same
  2. DTSTART/DTEND also should be the same for both
  3. in cancellation.ics METHOD and STATUS should be CANCEL and CANCELLED accordingly
Vaha
  • 2,179
  • 2
  • 17
  • 29
0

If we would refer to Using the iCalendar Format, events save in .ics file should still be uploaded into your calendar to be able to access them properly. As mentioned in this documentation, you can import an iCalendar file directly into your calendar by copying and pasting it into a text document. Save the document with an ".ics" extension, then upload it into your calendar.

Additionally, based from this forum, Google Calendar still has no feature of handling events directly from .ics files. If you want this feature to be added in Google Calendar, you can submit a feature request here.

However, you may also opt to try the given workaround in this post and see if it works for you.

Community
  • 1
  • 1
Teyam
  • 7,686
  • 3
  • 15
  • 22