Is there a way for me to delete items from calendar by using iCalendar import?
I know that there is a METHOD:CANCEL, however when I tried it, it didn't do anything to the calendar event.
Here is what is in my iCalendar file. When I try to import it to Outlook, it just adds these events.
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//DDay.iCal//NONSGML ddaysoftware.com//EN
METHOD:CANCEL
BEGIN:VEVENT
CREATED:20081210T155315Z
DESCRIPTION:
DTEND:20081213T093000
DTSTAMP:20081210T155315Z
DTSTART:20081213T093000
LOCATION:
ORGANIZER:MAILTO:user#domain.com
SEQUENCE:1
SUMMARY:From FCS 13th
UID:20367b86-2123-4930-87ef-5c2a6626bd9f
BEGIN:VALARM
ACTION:DISPLAY
SUMMARY: Event 13th
TRIGGER:-PT30M
END:VALARM
END:VEVENT
BEGIN:VEVENT
CREATED:20081210T155315Z
DESCRIPTION:
DTEND:20081211T093000
DTSTAMP:20081210T155315Z
DTSTART:20081211T093000
LOCATION:7 West
ORGANIZER:MAILTO:user#domain.com
SEQUENCE:1
SUMMARY:Event 11th
UID:f212ab15-86c3-46c8-8592-af0716a40ea2
BEGIN:VALARM
ACTION:DISPLAY
SUMMARY:Event on 11th
TRIGGER:-PT30M
END:VALARM
END:VEVENT
END:VCALENDAR
I forgot to add STATUS:CANCELLED
Now this should cancel items according to http://en.wikipedia.org/wiki/ICalendar#Events_.28VEVENT.29
This works in Google Calendar but not in Outlook 2003. Outlook still creates duplicate entries.
Here are modified "cancel" events with 'STATUS:CANCELLED'. (British spelling with two L's)
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//DDay.iCal//NONSGML ddaysoftware.com//EN
X-WR-RELCALID:928C8448-048A-4aa2-BE27-A920773AF3DC
METHOD:CANCEL
BEGIN:VEVENT
CREATED:20081210T210344Z
DESCRIPTION:
DTEND:20081213T093000
DTSTAMP:20081210T210344Z
DTSTART:20081213T093000
LOCATION:
ORGANIZER:MAILTO:user#domain.com
SEQUENCE:1
STATUS:CANCELLED
SUMMARY:Event to export 1
UID:20367b86-2123-4930-87ef-5c2a6626bd9f
BEGIN:VALARM
ACTION:DISPLAY
SUMMARY:Event to export 1
TRIGGER:-PT30M
END:VALARM
END:VEVENT
BEGIN:VEVENT
CREATED:20081210T210344Z
DESCRIPTION:
DTEND:20081211T093000
DTSTAMP:20081210T210344Z
DTSTART:20081211T093000
LOCATION:7 West
ORGANIZER:MAILTO:user#domain.com
SEQUENCE:1
STATUS:CANCELLED
SUMMARY:Event to export 2
UID:f212ab15-86c3-46c8-8592-af0716a40ea2
BEGIN:VALARM
ACTION:DISPLAY
SUMMARY:Event to export 2
TRIGGER:-PT30M
END:VALARM
END:VEVENT
END:VCALENDAR
I was struggling with this for a while.
As a few others have mentioned you must include the:
METHOD:CANCEL
and
STATUS:CANCELLED
lines of the VEVENT. The UID must be the same as the original event AND the SEQUENCE: number must be the CURRENT sequence number! (you do not need to add 1 from the last sequence number as cancelling the event does not count as an update).
I was having issues as I assumed that the cancellation counted as an update and was therefore incrementing my sequence number, but you do not have to!
This answer is meant for iCal URL feeds not for importing an iCal file!
I looked into this for quite a while and since the answer given doesn't actually resolve the issue for outlook I thought I would post what I have found to work for Outlook, iCal, and Google Calendar.
You just simply do not send the event, if the event is outright just not in the feed anymore then Outlook, Google Calendar, and iCal (from my testing) all just remove the event as if it never existed. So if the event has been cancelled just pretend it never existed and when the local calendars sync they will show events that are explicitly given to them in the feed.
This can be a painful and unpredictable business, and is likely dependent on Outlook version. I have got event cancellations working with Outlook 2010 (v14). I send my icalendar as a single-part message, type text/calendar, as discussed in this thread. As mentionned in the other answers, I have method=CANCEL in the MIME type, and again in the icalendar.
The critical step for me was to add DTSTART to the event. Without this field, the message is not presented as a cancellation, there is nothing in the preview pane, and the calendar is presented as an attachment with the filename "not supported calendar message.ics". But you can put any date you like in the field! DTEND is not important. SEQUENCE could be the same or greater. DTSTAMP is not important, but if present, must be after the DTSTAMP sent with the initial invitation, otherwise the text "not active" appears instead of the "delete from calendar" button.
This is a minimal working cancellation...
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//www.notilus.com//Dimo Gestion Notilus//FR
CALSCALE:GREGORIAN
METHOD:CANCEL
BEGIN:VEVENT
DTSTART:20140625T123000Z
SEQUENCE:1
STATUS:CANCELLED
UID:Kerry
END:VEVENT
END:VCALENDAR
I might need to set X-WR-RELCALID tag, according to this http://www.oesf.org/forum/index.php?act=Print&client=printer&f=63&t=2650
It states: "Before syncing for the first time, you MUST add a X-WR-RELCALID tag to the mycalendar.ics file, or else iCal will change the UID number of all entries, causing duplicates."
However I can't find any documentation on RELCALID tag in protocol https://www.rfc-editor.org/rfc/rfc2446
When I set X-WR-RELCALID, Outlook still creates duplicate events instead of removing those events.
Is there any documentation on X-WR-RELCALID? I can't find it.
I don´t know if this helps, try setting SEQUENCE: 2
For me it worked by setting the X-WR-RELCALID tag in the header of the ics file. Then Outlook recognized the event as the same.
Outlook creates a duplicate event if you change the UID property.
You have to create another event with the same UID.
You should do these steps to delete the calendar event
UID must be same
Add METHOD:CANCEL
Add STATUS:CANCELLED
SEQUENCE must be greater than the created event
Related
I'm working on a scheduling application that utilizes an ics file to set up an appointment in outlook, the issue im having is that the appointment time changes depending on timezone and im not wanting it too. For example i want to set an appointment from 11am-noon from central time, the ics would change to adjust to the timezone eastern and make it from noon - 1pm. Here is what my ICS file looks like. I tried specifying Timezones in the TZID but it would always adjust.
BEGIN:VCALENDAR
VERSION:2.0
METHOD:REQUEST
BEGIN:VEVENT
ATTENDEE;CN=email<email#email.org>;RSVP=TRUE:mailto:email#email.org
CLASS:PUBLIC
CREATED:20201007T114658Z
DESCRIPTION:
DTEND;TZID="Central Standard Time":20201007T120000
DTSTAMP:20201007T114908
DTSTART;TZID="Central Standard Time":20201007T110000
LOCATION:Unknown
ORGANIZER;CN="Appointment":mailto:AppointmentsManager#email.org
PRIORITY:5
SEQUENCE:1
SUMMARY;LANGUAGE=en-us:east
TRANSP:OPAQUE
UID:X9053866f41994acda100ded7fb305ebe
BEGIN:VALARM
TRIGGER:-PT1H
ACTION:DISPLAY
DESCRIPTION:Reminder
END:VALARM
END:VEVENT
END:VCALENDAR
Your ICS file does not have a VTIMEZONE component. If you specify a TZID for an event's start/end time, you must create a corresponding VTIMEZONE component that provides the definition for that timezone.
Alternatively, you could convert the start/end time to UTC, which means you don't need a TZID parameter:
DTEND:20201007T170000Z
DTSTART:20201007T160000Z
Another alternative: Use an Olsen timezone ID in the TZID parameter and prefix it with a slash. However, this is not guaranteed to work with all mail clients.
DTEND;TZID="/America/Chicago":20201007T120000
DTSTART;TZID="/America/Chicago":20201007T110000
I'm writing a system in Python that is using the icalendar library to generate ical invites. Those work fantastically, but if I try to send out a cancellation Outlook just displays the dreaded "not supported calendar message.ics". I originally had this issue with the invite, but solved it by fixing my date formatting.
Here is the initial invite:
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//myapp//myapp.example.com//
METHOD:REQUEST
BEGIN:VEVENT
SUMMARY:Weekly Review Meeting
DTSTART;VALUE=DATE-TIME:20200331T190000Z
DTEND;VALUE=DATE-TIME:20200331T200000Z
DTSTAMP;VALUE=DATE-TIME:20200325T193007Z
UID:1#myapp
SEQUENCE:0
ATTENDEE:me#example.com
CATEGORY:EVENT
CLASS:PUBLIC
DESCRIPTION:bla bla
LOCATION:Webex
ORGANIZER:donotreply#example.com
PRIORITY:5
STATUS:CONFIRMED
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:REMINDER
TRIGGER;RELATED=START:-PT15M
END:VALARM
END:VEVENT
END:VCALENDAR
And then the cancellation:
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//myapp//myapp.example.com//
METHOD:CANCEL
BEGIN:VEVENT
SUMMARY:Weekly Review Meeting
DTSTART;VALUE=DATE-TIME:20200331T190000Z
DTEND;VALUE=DATE-TIME:20200331T200000Z
DTSTAMP;VALUE=DATE-TIME:20200325T193011Z
UID:1#myapp
SEQUENCE:1
ATTENDEE:me#example.com
CATEGORY:EVENT
CLASS:PUBLIC
DESCRIPTION:
LOCATION:Webex
ORGANIZER:donotreply#example.com
PRIORITY:5
STATUS:CANCELLED
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:REMINDER
TRIGGER;RELATED=START:-PT15M
END:VALARM
END:VEVENT
END:VCALENDAR
The same code generates both and sets the METHOD and STATUS differently (DESCRIPTION also differs). I send a SEQUENCE of 0 for the invite and 1 for the cancellation. The UIDs are always consistent between the matching pair. What am I missing?
I ended up solving this myself. I will share my learnings for posterity.
The MIME type in the email needs to be set with method=CANCEL as well. This was ultimately my issue. method in the MIME type needs to match METHOD in the ical file and both are required for Outlook to process it correctly.
SEQUENCE should not be incremented for cancellation, just for update.
I also updated all addresses (ORGANIZER and ATTENDEE) to include mailto:, but this does not appear to be strictly necessary.
I am using .ics file to send calendar invite to google users from my app, when a user is removed from the attendees in my app,
I am resending the .ics with updated attendees list to attendees who are still in the meeting.
send the removed attendees new .ics with cancel event.
however, the removed attendees are still showing in the event for other users.
how do I remove attendees from event using ICS?
first .ics:
BEGIN:VCALENDAR
VERSION:2.0
PRODID:MyDemoApp
METHOD:REQUEST
BEGIN:VEVENT
UID:useremovetest1jdfshsdpfh
SEQUENCE:0
CREATED:20191014T085551Z
DTSTAMP:20191014T085551Z
LAST-MODIFIED:20191014T085551Z
DTSTART:20191014T112347Z
DTEND:20191014T113547Z
SUMMARY:user remove test - 2
LOCATION:#my-dev-env
DESCRIPTION:some dummy desc
ATTENDEE;CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=
true:mailto:user1#gmail.com
ATTENDEE;CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=
true:mailto:user2#gmail.com
ATTENDEE;CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=
true:mailto:user3#gmail.com
ORGANIZER;CN=Invitation - user remove test - 2:user1#gmail.com
END:VEVENT
END:VCALENDAR
.ics when a attendee is removed:
BEGIN:VCALENDAR
VERSION:2.0
PRODID:MyDemoApp
METHOD:REQUEST
BEGIN:VEVENT
UID:useremovetest1jdfshsdpfh
SEQUENCE:0
CREATED:20191014T085422Z
DTSTAMP:20191014T085422Z
LAST-MODIFIED:20191014T085422Z
DTSTART:20191014T112347Z
DTEND:20191014T113547Z
SUMMARY:user remove test - 2
LOCATION:#my-dev-env
DESCRIPTION:some dummy desc - update
ATTENDEE;ROLE=REQ-PARTICIPANT;RSVP=true;CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-AC
TION:mailto:user1#gmail.com
ATTENDEE;CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=
true:mailto:TION:mailto:user2#gmail.com
ORGANIZER;CN=Invitation - user remove test - 2:user1#gmail.com
END:VEVENT
END:VCALENDAR
user2#gmail.com still stays in the attendee list. however, title, desc etc are updating successfully.
It looks like your DTSTAMP and LAST-MODIFIED values are "backward" in the sense that the updated invite has an earlier timestamp than the original one.
First invite:
DTSTAMP:20191014T085551Z
Updated invite:
DTSTAMP:20191014T085422Z
As a consequence this second ics is likely to be ignored by clients as per https://www.rfc-editor.org/rfc/rfc5546#section-2.1.5
I am trying to implement external appointment management (using VCAL2) - namely CREATE, UPDATE and CANCEL appointment - and I need it to work with Lotus Notes (and possibly in MS Outlook).
My VCAL2 files are in my opinion correct (RFC 5545), and CREATE and UPDATE actually works well. Problem is only with CANCEL and only in MS Outlook and Lotus Notes - they seem to ignore the cancellation request.
CREATE.ics
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//myprod//ical-poc//SK
METHOD:PUBLISH
X-WR-RELCALID:5EF979C9-3764-4B55-93B8-3BB00DFA176C#uniq.id
X-PUBLISHED-TTL:P1W
BEGIN:VEVENT
UID:5EF979C9-3764-4B55-93B8-3BB00DFA176C#uniq.id
DTSTART;TZID=Europe/Bratislava:20150701T090000
SEQUENCE:0
TRANSP:OPAQUE
STATUS:CONFIRMED
DTEND;TZID=Europe/Bratislava:20150701T093000
SUMMARY:CREATED
ATTENDEE:mailto:valid#email.xxx
DESCRIPTION:Event description.
ORGANIZER:mailto:cal-poc#domain.com
DTSTAMP:20150630T182305Z
END:VEVENT
END:VCALENDAR
UPDATE.ics
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//myprod//ical-poc//SK
METHOD:REQUEST
X-WR-RELCALID:5EF979C9-3764-4B55-93B8-3BB00DFA176C#uniq.id
X-PUBLISHED-TTL:P1W
BEGIN:VEVENT
UID:5EF979C9-3764-4B55-93B8-3BB00DFA176C#uniq.id
DTSTART;TZID=Europe/Bratislava:20150701T110000
SEQUENCE:1
TRANSP:OPAQUE
STATUS:CONFIRMED
DTEND;TZID=Europe/Bratislava:20150701T113000
SUMMARY:UPDATED+2
ATTENDEE:mailto:valid#email.xxx
DESCRIPTION:Event description.
ORGANIZER:mailto:cal-poc#domain.com
DTSTAMP:20150630T182428Z
END:VEVENT
END:VCALENDAR
CANCEL.ics
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//myprod//ical-poc//SK
METHOD:CANCEL
X-WR-RELCALID:5EF979C9-3764-4B55-93B8-3BB00DFA176C#uniq.id
X-PUBLISHED-TTL:P1W
BEGIN:VEVENT
UID:5EF979C9-3764-4B55-93B8-3BB00DFA176C#uniq.id
DTSTART;TZID=Europe/Bratislava:20150701T110000
SEQUENCE:1
TRANSP:OPAQUE
STATUS:CANCELLED
DTEND;TZID=Europe/Bratislava:20150701T113000
SUMMARY:CREATED+2
ATTENDEE:mailto:valid#email.xxx
DESCRIPTION:Event description.
ORGANIZER:mailto:cal-poc#domain.com
DTSTAMP:20150630T182457Z
END:VEVENT
END:VCALENDAR
As almost always, answering my question (it seems, posting it on S/O gives me some superpowers to find an answer in the next few hours).
It seems, there are multiple combinations of properties in iCal format, that form the valid file for each client. Following is my analysis of it (please note, it does not support RSVPs, but RSVPs only require few more tweaks to the file like slightly different methods etc. and the point of the question was cancellation):
CREATE & UPDATE APPOINTMENT
All Applications:
METHOD must be PUBLISH
DTSTART and DTEND (or DURATION) present
SEQUENCE must be incremented on each update
ORGANIZER must be present
UID must be present
X-WR-RELCALID for Outlook must be present and equal to UID
PRODID must be present
STATUS should be CONFIRMED
CANCEL
All Applications:
STATUS must be CANCELLED
all other fields as above
Apple Calendar:
METHOD must be PUBLISH (or actually, must not be CANCEL)
DURATION (or DTEND) must be present
Microsoft Outlook:
METHOD must be CANCEL
DURATION (or DTEND) MUST NOT be present
Lotus Notes:
METHOD must be CANCEL
DURATION (or DTEND) must be present
I am trying to create a .ics file for an event that spreads over 5 days. An example of the .ics content is found below:
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
UID:BestMedTourDeBoland
DTSTART:20150302T000000
DTEND:20150306T230000
SUMMARY:Bestmed Tour De Boland
PRIORITY:3
END:VEVENT
END:VCALENDAR
As you can see the start date is set for 02 March and spans until the end of 06 March. When I import the .ics file I get the "outlook supports floating time for all-day events only" message. Any help on fixing this please?
It is telling you the problem: Don't use the floating time format for multi day events. Stick a Z after the DTSTART for UTC time or add a timezone identifier.
RFC 5545 explains the date format options: https://www.rfc-editor.org/rfc/rfc5545#page-33
or specifically on floating:
http://icalevents.com/2064-ical-local-or-floating-date-times/
Example:
`DTSTART:20100202T151500Z`
or with timezone id:
DTSTART;TZID=”America/New_York”:20080807T090000