I'm making some requests to retrieve event data from an iCloud calendar.
I need to fetch expanded events by filtering events between a start and end date. So far, so good. However, when retrieving the data from the .ics file, I noticed that the event status is not included, only the participants' statuses.
I have already tried adding the necessary fields in the query, but it's still not being returned. I need help on how to retrieve the status.
Below is my query:
<?xml version="1.0" encoding="utf-8" ?>
<C:calendar-query xmlns:D="DAV:"
xmlns:C="urn:ietf:params:xml:ns:caldav"
xmlns:ca="http://apple.com/ns/ical/">
<D:prop>
<D:getetag/>
<C:calendar-data>
<C:expand start="20230723T030000Z" end="20231023T025959Z"/>
</C:calendar-data>
</D:prop>
<C:filter>
<C:comp-filter name="VCALENDAR">
<C:comp-filter name="VEVENT">
<C:time-range start="20230723T030000Z"
end="20231023T025959Z"/>
</C:comp-filter>
</C:comp-filter>
</C:filter>
</C:calendar-query>
I also tried this format, but with no success
<?xml version="1.0" encoding="utf-8" ?>
<C:calendar-query xmlns:D="DAV:"
xmlns:C="urn:ietf:params:xml:ns:caldav">
<D:prop>
<D:getetag/>
<C:calendar-data>
<C:expand start="20230723T030000Z" end="20231023T025959Z"/>
<C:comp name="VCALENDAR">
<C:prop name="VERSION"/>
<C:comp name="VEVENT">
<C:prop name="SUMMARY"/>
<C:prop name="UID"/>
<C:prop name="DTSTART"/>
<C:prop name="DTEND"/>
<C:prop name="DURATION"/>
<C:prop name="RRULE"/>
<C:prop name="RDATE"/>
<C:prop name="EXRULE"/>
<C:prop name="EXDATE"/>
<C:prop name="RECURRENCE-ID"/>
<C:prop name="STATUS"/>
</C:comp>
<C:comp name="VTIMEZONE"/>
</C:comp>
</C:calendar-data>
</D:prop>
<C:filter>
<C:comp-filter name="VCALENDAR">
<C:comp-filter name="VEVENT">
<C:time-range start="20230723T030000Z"
end="20231023T025959Z"/>
</C:comp-filter>
</C:comp-filter>
</C:filter>
</C:calendar-query>
Curl request used for this:
curl -o response.txt -X REPORT -H "Depth: 1" -H "Content-Type: application/xml" -H "Authorization: Basic my-token" --data-binary "@query.xml" https://p<number>-caldav.icloud.com/<user-id>/calendars/<calendar-id>