icloudcarddav

number-of-matches-within-limits requesting CardDav server


I recently tried to read alot of VCards from iCloud CardDav server. However I realized there is a limit on the 5000th vCard I request.

Here is my REPORT request:

<?xml version="1.0" encoding="utf-8" ?>
   <C:addressbook-query xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:carddav">
   <C:filter>
      <C:prop-filter name="X-ADDRESSBOOKSERVER-KIND" test="anyof">
         <C:is-not-defined />
         <C:text-match collation="i;unicode-casemap" match-type="equals" negate-condition="yes">group</C:text-match>
      </C:prop-filter>
   </C:filter>
</C:addressbook-query>

And here is the end of the server answer:

<response>
   <href>/872816606/carddavhome/card/</href>
   <status>HTTP/1.1 507 OK</status>
   <error><number-of-matches-within-limits/></error>
</response>

Is there a way to query the next page?

Thanks in advance.


Solution

  • CardDAV all by itself does not offer a paging mechanism. WebDAV Sync (https://www.rfc-editor.org/rfc/rfc6578) on the other hand does provide paging, although not all server implementations do support paging.

    Now, if understand your query, you are pretty much asking for all contacts in the collection, except for groups. Unless you have a very large number of groups, you probably want to filter them on the client side, in which case you can use a regular PROPFIND (or WebDAV Sync REPORT), followed by series of CarDAV multiget REPORTs, which is what most clients do.