Netxcloud/Carddav Sync Using ApacheJackRabbit

  • hi,

    I’m trying to run basic steps to optimize my sever contacts synchronization with nextcloud contacts’s cardav using SabreDav Specification like this one :
    The most suitable one is to get the nextcloud Ctag and comapre it with your server Ctag using a PROPFIND method to get the Ctag and the sysnc token


       PROPFIND /addressbooks/johndoe/contacts/ HTTP/1.1
           Depth: 0
          Content-Type: application/xml; charset=utf-8
          <d:propfind xmlns:d="DAV:" xmlns:cs="">
            <d:displayname />
            <cs:getctag />
            <d:sync-token />

    the response will be like this :

        ```<d:multistatus xmlns:d="DAV:" xmlns:cs="">
                <d:displayname>My Address Book</d:displayname>
            <d:status>HTTP/1.1 200 OK</d:status>

    But when i try the “WebDAV-Sync” fearture by the sync token from this request :

    REPORT /addressbooks/johndoe/contacts/ HTTP/1.1
    Content-Type: application/xml; charset="utf-8"
    <?xml version="1.0" encoding="utf-8" ?>
    <d:sync-collection xmlns:d="DAV:">
    <d:sync-token>   SYNC-TOKEN  </d:sync-token>

    I get this response indicating that i have the wrong token

    <?xml version="1.0" encoding="utf-8"?>
    <d:error xmlns:d="DAV:" xmlns:s="">
    <s:message>Invalid or unknown sync token</s:message>

    This step helps us optimize synchronization time and data as it return only the changed contacts, but the nextcloud server doesn’t recognize token despite that it implements SabreDav and it return a sync token.

    I hope that someone can help me as it 's the firest time that i write in this forum.

  • I get it done by changing the SYNCTOKEN_PREFIX form the SabreDav Doc to the nextcloud one according this link :   SYNC-TOKEN     =>   SYNC-TOKEN

    Hope it helps.

Similar topics