How to get icloud calendar freebusy information?

Hello! I'm trying to figure out how to get information about a user's busyness. My request to the outbox returns a 403 error, although any other request with the same access data is executed correctly.

curl --location --request POST 'https://p48-caldav.icloud.com/userID/calendars/outbox/' \
--header 'Content-Type: text/calendar; charset="utf-8"' \
--header 'Authorization: Basic xxxx' \
--data-raw 'BEGIN:VCALENDAR
VERSION:2.0
METHOD:REQUEST
BEGIN:VFREEBUSY
UID:a4ee6514
DTSTAMP:20220113T165506Z
DTSTART;VALUE=DATE:20220113T165506Z
DTEND;VALUE=DATE:20220113T165506Z
ORGANIZER;CN="OM":mailto:mymail@icloud.com
ATTENDEE;CN="OM":mailto:mymail@icloud.com
END:VFREEBUSY
END:VCALENDAR
'

I also tried the report free-busy-query request, it returns a 400 error, I took it from https://datatracker.ietf.org/doc/html/rfc4791#section-7.10.1.

curl --location --request REPORT 'https://p48-caldav.icloud.com/userID/calendars/work/' \
--header 'Depth: 1' \
--header 'Content-Type: application/xml; charset="utf-8"' \
--header 'Authorization: Basic xxxx' \
--data-raw '<?xml version="1.0" encoding="utf-8" ?>
<C:free-busy-query xmlns:C="urn:ietf:params:xml:ns:caldav">
    <C:time-range start="20220101T140000Z"
                     end="20220129T220000Z"/>
</C:free-busy-query>'

I would love to hear your advice and suggestions.

Replies

Pretty sure me too. My published .vfb file looks the same as the above, in other words empty. Contains no free\busy times. Interestingly when I do the following in Outlook: File --> Options --> Calendar --> Free\Busy Options --> increase Publish # months from 0 to 2 --> press OK.  Then I press Free\Busy Options button again --> Publish # months has changed back to 0 again. It forgets that I've set it to 2. Why? Is this what you experience too @kingol6?

Seems like a bug with iCloud calendars. I was on the phone to Microsoft Support about this yesterday and publishing free\busy times worked fine with a live.com calendar.