syncCollection
syncCollection
Section titled “syncCollection”One way to synchronize data between two entities is to use some form of synchronization token
const result = await syncCollection({ url: 'https://caldav.icloud.com/12345676/calendars/c623f6be-a2d4-4c60-932a-043e67025dde/', props: { [`${DAVNamespaceShort.DAV}:getetag`]: {}, [`${DAVNamespaceShort.CALDAV}:calendar-data`]: {}, [`${DAVNamespaceShort.DAV}:displayname`]: {}, }, syncLevel: 1, syncToken: 'bb399205ff6ff07', headers: { authorization: 'Basic x0C9ueWd9Vz8OwS0DEAtkAlj', },});Arguments
Section titled “Arguments”urlrequired, target collection urlpropsrequired, ElementCompactsyncLevelIndicates the “scope” of the synchronization report requestsyncTokenThe synchronization token provided by the server and returned by the clientheadersrequest headersheadersToExcludearray of keys of the headers you want to excludefetchOptionsoptions to pass to underlying fetch function
Return Value
Section titled “Return Value”array of DAVResponse
Behavior
Section titled “Behavior”send sync-collection REPORT to target collection url, parse response xml into array of DAVResponse