syncCollection
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: [
{ name: 'getetag', namespace: DAVNamespace.DAV },
{ name: 'calendar-data', namespace: DAVNamespace.CALDAV },
{ name: 'displayname', namespace: DAVNamespace.DAV },
],
syncLevel: 1,
syncToken: 'bb399205ff6ff07',
headers: {
authorization: 'Basic x0C9ueWd9Vz8OwS0DEAtkAlj',
},
});
Arguments
url
required, target collection urlprops
required, DAVProp of the requestsyncLevel
Indicates the "scope" of the synchronization report requestsyncToken
The synchronization token provided by the server and returned by the clientheaders
request headers
Return Value
array of DAVResponse
Behavior
send sync-collection REPORT to target collection url, parse response xml into array of DAVResponse