iCloud CardDAV stopped working, returning "(400) Bad Request"

It was all fine until yesterday, all of a sudden I've been getting:


The remote server returned an error: (400) Bad Request


I'm afraid Apple has done some change to the service this week but

don't know where to look for the new specs.


Is anyone aware of the changes?


Here's the request to https://contacts.icloud.com:


Content-Type: text/xml
Depth: 1


<?xml version="1.0" encoding="utf-8"?>
<D:propfind xmlns:D="DAV:">
<D:prop>
<D:current-user-principal />
</D:prop>
</D:propfind>


I'm using TLS 1.2.

Thanks

Replies

seeing the same here -- thought I'd bungled my code somehow, but looks like I'm not alone. I've got the "Bad Request" on initial call to calendar https://caldav.iclound.com, with Depth: 0. Worked last week.

Don't you get any other information back from server, as HTTP body in the 400 response ?


May read this:

https://stackoverflow.com/questions/50720196/creating-new-event-to-icloud-apple-calendar-always-results-400-bad-request


Where did you get the syntax of this request ?

Is it RFC 4918 ? h ttps://tools.ietf.org/html/rfc4918



I read here an example

h ttp://sabre.io/dav/building-a-caldav-client/

and see that

<D:propfind xmlns:D="DAV:"> contains more information to provide an url


Could it be the problem ?

Same issue applies to https://caldav.icloud.com. I just started noticing today, and someone else brought it up on StackOverflow:

https://stackoverflow.com/questions/57920341/not-able-to-get-current-user-principal-for-user-from-apple-caldav-server


Hoping this gets fixed soon!

from caldav.icloud.com, no content is returned, only 400 error.

< HTTP/1.1 400 Bad Request
< Server: AppleHttpServer/e70a1a237a4f
< Date: Fri, 13 Sep 2019 18:05:29 GMT
< Content-Length: 0
< Connection: keep-alive


"Bad Request" is typically user-provided bad information, (rather than a permission problem), as it worked last week and not now, I suspect it's a recent change on the server-side.

There's a temporary solution for the issue, it's hacky but works like charm...


https://stackoverflow.com/questions/57920341/not-able-to-get-current-user-principal-for-user-from-apple-caldav-server?answertab=votes#tab-tophttp://