I developed a client for iCloud calendar service that uses CalDAV protocol. I use caldav4j library for Java, however the problem I encountered is language/library independent.
Several days ago creating of new calendars in my client stopped working. Now, I get 412 Precondition Failed
status code while sending MKCALENDAR requests to iCloud. Other operations, like getting list of calendar resources, getting events, creating and updating events work the same as before.
I tried also to CURL it and to use Postman to send similar requests and results are always the same - 412 Precondition Failed. Example request send by my client to create new calendar looks like this:
MKCALENDAR /xxxxxxxxxx/calendars/2321321CH34CHU35Y4UI5YVU31TIBCYTUIYBUI3
HTTP/1.1
Host: caldav.icloud.com
Content-Type: text/xml
Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==
cache-control: no-cache
<?xml version="1.0" encoding="UTF-8"?>
<C:mkcalendar xmlns:C="urn:ietf:params:xml:ns:caldav">
<D:set xmlns:D="DAV:">
<D:prop>
<D:displayname>new calendar</D:displayname>
<C:calendar-description xml:lang="en">my description</C:calendar-description>
</D:prop>
</D:set>
</C:mkcalendar>
Parts with xxxxx contains my proper principal id and authorization token.
Does anybody know if Apple has changed there something recently? I'm sure I didn't changed anything in my code and requests like the one in example above worked successfully a few days ago.