Search code examples
icalendarvcalendar

ICS Response mecanism


I have some issues responding in PHP to an ics invitation. My script receives:

BEGIN:VCALENDAR
PRODID:-//Google Inc//Google Calendar 70.9054//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VEVENT
DTSTART:20170623T140000Z
DTEND:20170623T150000Z
DTSTAMP:20170531T131034Z
ORGANIZER;CN=Jona xxx:mailto:[email protected]
UID:[uid]@google.com
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=
 TRUE;[email protected];X-NUM-GUESTS=0:mailto:[email protected]
CREATED:20170531T131034Z
DESCRIPTION:Affichez votre événement sur la page ...
LAST-MODIFIED:20170531T131034Z
LOCATION:
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Nouvel évènement
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR

Then I change the PARTSTAT of the concerned attendee to ACCEPTED and return the ics as a mail attachment.

BEGIN:VCALENDAR
PRODID:-//Google Inc//Google Calendar 70.9054//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VEVENT
DTSTART:20170623T140000
DTEND:20170623T150000
DTSTAMP:20170531T131034
ORGANIZER;CN=Jona xxx:mailto:[email protected]
UID:[uid]@google.com
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;X-NUM-GUESTS=0:mailto:[email protected]
CREATED:20170531T011034
DESCRIPTION:Affichez votre événement sur la page ...
LAST-MODIFIED:20170531T031036
LOCATION:
SEQUENCE:1
STATUS:CONFIRMED
SUMMARY:Nouvel évènement
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR

The issue is when i receive the response, i see it as an invitation and Thunderbird does not update the event.

What am I doing wrong?


Solution

  • Ok, i found out what was wrong. I missed the 'METHOD' field in the VCALENDAR node. To reply, the METHOD must be set on REPLY. https://www.rfc-editor.org/rfc/rfc5545#page-78