The following examples show how to use the
Data.getSyncStatus action, providing examples of the results that the action returns. The
JavaScript examples do not show how to
create a connection to a data source, but the
dataId variable used would be from a call to
Data.open. The results are shown in
JSON.
The summary contains information about each synchronization service used for a data synchronization operation.
CS.Data.getSyncStatus({
dataId,
content: "summary"
});
Sample result:
{
"lastPut": {
"time": "2026-06-09T15:27:03Z",
"deviceId": "588850ce-330b-4afd-8282-7603e955a7a3",
"deviceName": "https://example.org/csweb/api/",
"username": "jackw",
"universe": "",
"direction": "put",
"partial": false
},
"lastGet": {
"time": "2026-06-03T18:34:25Z",
"deviceId": "Dropbox",
"deviceName": "Dropbox",
"username": "jackw@example.org",
"universe": "",
"direction": "get",
"partial": false
}
}
Filtering on a device shows only information for a particular synchronization service, and also provides information about the number of cases that are pending synchronization. This number means that, if you put data to this service, roughly this number of cases would be transferred.
CS.Data.getSyncStatus({
dataId,
content: "summary"
deviceName: "https://example.org/csweb/api/"
});
Sample result:
{
"lastPut": {
"time": "2026-06-09T15:27:03Z",
"deviceId": "588850ce-330b-4afd-8282-7603e955a7a3",
"deviceName": "https://example.org/csweb/api/",
"username": "jackw",
"universe": "",
"direction": "put",
"partial": false
},
"casesPendingSync": 3
}
The synchronization history is returned ordered from newest to oldest.
CS.Data.getSyncStatus({
dataId,
content: "syncHistory"
});
Sample result:
{
"syncHistory": [
{
"time": "2026-06-09T15:27:03Z",
"deviceId": "588850ce-330b-4afd-8282-7603e955a7a3",
"deviceName": "https://example.org/csweb/api/",
"username": "jackw",
"universe": "",
"direction": "put",
"partial": false
},
{
"time": "2026-06-08T19:38:18Z",
"deviceId": "588850ce-330b-4afd-8282-7603e955a7a3",
"deviceName": "https://example.org/csweb/api/",
"username": "jackw",
"universe": "",
"direction": "put",
"partial": false
},
{
"time": "2026-06-03T18:34:25Z",
"deviceId": "Dropbox",
"deviceName": "Dropbox",
"username": "jackw@example.org",
"universe": "",
"direction": "get",
"partial": false
}
],
"lastGet": {
"time": "2026-06-03T18:34:25Z",
"deviceId": "Dropbox",
"deviceName": "Dropbox",
"username": "jackw@example.org",
"universe": "",
"direction": "get",
"partial": false
},
"lastPut": {
"time": "2026-06-09T15:27:03Z",
"deviceId": "588850ce-330b-4afd-8282-7603e955a7a3",
"deviceName": "https://example.org/csweb/api/",
"username": "jackw",
"universe": "",
"direction": "put",
"partial": false
}
}
Each synchronization service may have multiple device names. For example, if a
CSWeb server's URL changes, the device ID will be constant but the names will reflect both the old and new URLs.
CS.Data.getSyncStatus({
dataId,
content: "syncServices"
});
Sample result:
[
{
"deviceId": "588850ce-330b-4afd-8282-7603e955a7a3",
"deviceNames": [
"https://example.org/csweb/api/",
"http://localhost/csweb81/api/"
],
"firstSyncTime": "2026-05-05T08:27:03Z",
"lastSyncTime": "2026-06-09T15:27:03Z"
},
{
"deviceId": "Dropbox",
"deviceNames": [
"Dropbox"
],
"firstSyncTime": "2026-06-03T18:34:25Z",
"lastSyncTime": "2026-06-03T18:34:25Z"
}
]
The cases pending synchronization are cases that have not been put from the data source to a synchronization service.
CS.Data.getSyncStatus({
dataId,
content: "casesPendingSync",
deviceName: "https://example.org/csweb/api/"
});
Sample result:
[
{
"key": "4480489263555",
"position": 609,
"uuid": "38ed23c6-1967-465a-8011-00287bc9792b"
},
{
"key": "4480489263333",
"position": 3,
"uuid": "48e6b01e-734b-4cdb-b30d-fbcd2ea104e3"
},
{
"key": "4480489263666",
"position": 1249,
"uuid": "49720a7c-945c-49e5-b888-12dfde1810ff"
}
]
The case status reflects information about the current version of the case. A case may have been synchronized and then later modified, but if the modified case was not synchronized, the synchronization history array will be empty.
CS.Data.getSyncStatus({
dataId,
content: "caseStatus",
deviceName: "https://example.org/csweb/api/",
key: "4480489263666"
});
Sample result for a case pending synchronization:
{
"key": "4480489263666",
"position": 1249,
"uuid": "49720a7c-945c-49e5-b888-12dfde1810ff",
"syncHistory": []
}
Sample result for a case that has been synchronized:
{
"key": "4480586623555",
"position": 205,
"uuid": "73354b1b-f7c0-48f2-8943-538e77a61e7b",
"syncHistory": [
{
"time": "2026-06-09T15:27:03Z",
"deviceId": "588850ce-330b-4afd-8282-7603e955a7a3",
"deviceName": "https://example.org/csweb/api/",
"username": "jackw",
"universe": "",
"direction": "put",
"partial": false
}
]
}