Let’s assume we have the last sync time in a variable called lastSyncTime
.
Using the Content List Endpoint
POST /api/content/{projectId}/entity/{entityName}/search
Parameters
Name | Type | Default | Description |
---|---|---|---|
firstResult | Int | Not default must be provided | Offset |
maxResults | Int | true | Size |
sortParamList | String[] | [_amid] | Sort fields |
Body
OptionalContent Where Condition .
Example Request
POST /api/content/kurs/entity/arkiv/search
The following condition can be used for finding contents created/updated after the lastSyncTime
{ "type": "binary", "value1": { "type": "column", "columnName": "updated" }, "operator": "GREATER_THAN", "value2": { "type": "direct", "value": "2024-01-01T00:00:00Z", "castAs": "timestamp" } }
Example Response
[ { "_amid": "21124e96-66cb-4cf3-88e5-1b3591e02ef3", "identifikator": "A-1011", "innhold": "Vår største styrke er evnen til å tiltrekke oss og beholde noen av de beste utviklerne i Dhaka - et enormt spennende arbeidsmarked. Vi kan derfor skaffe erfarne seniorutviklere med kompetanse det nesten er umulig å finne i Norge - og det til en kostnad langt lavere enn lokale ansettelser eller innleide konsulenter.", "navn": "Oslo ferieleir", "created": "2023-06-21T08:48:46.500+00:00", "created_by": "sys_admin", "updated": "2024-09-12T07:46:11.442+00:00", "updated_by": "sys_admin", "kasskode": null, "arkivid": "319f07ba-e894-4a31-a731-62bc3cd18072", "merknad": null, "sluttdato": "1993.05.01", "startdato": "1975", "presisjon": "E", "omfang": null, "omfangenhet": null, "ordningsgrad": "C", "ordnetav": null, "ordnetdato": null, "katalogisering": null, "katalogmedium": null, "katalogreferanse": null, "asta5urn": "no-KURS_arkiv_000000000109", "depotstatus": "AV", "bevarinsgstid": 0, "kassasjonsar": null, "ispublishenabled": true, "fargebilde": false, "bunnmateriale": "0", "teknikk": "0", "fysisktilstand": "0", "beskrivelse": null, "planlagtkonservering": null, "bredde": null, "hoyde": null, "malestokk": null, "teknikkmerknad": null, "lokasjon": "SAO", "arkivlast": false, "date": null } ]
In case there are more results the X-Can-Paginate
response header will be present
Limitations
Using this endpoint it is not possible to find out the deleted contents.
Either we need to iterate over all the contents and check batch by batch if they exists in Asta7 or not. Better alternative would be to use the v=event log endpoint to find the deleted contents.
As updated
field is optional, it is possible that the value might be missing for some rows.
Using the Event Log Endpoint
/api/logs/event-log/project/{projectId}
Parameters
Name | Type | Default | Description |
---|---|---|---|
timestampFrom | Timestamp | Filter logs by | |
timestampTo | Timestamp | Filter logs by | |
eventTypes | String[] | Filter log by
| |
orderBy | String |
| Sort field name |
direction | String |
| Sort order |
pageSize | Int |
| Batch size, >= 1 |
pageIndex | Int |
| Batch index, >= 0 |
getCount | Boolean |
| Should return total count as |
Request Headers
Name | Type | Default | Description |
---|---|---|---|
time-zone | String |
| Time zone to convert the timestamps into |
Example Request
/api/logs/event-log/project/kurs?getCount=true&eventTypes=DELETE×tampFrom=2024-11-01T00:00:00.000
Example Response
[ { "eventLogId": "67286039f06af15b87786088", "projectId": "kurs", "entityName": "ARKIV", "amid": "c19a72ac-0b5b-4a70-85bc-133ecb7523f7", "timestamp": "2024-11-04T06:48:41.053", "eventType": "DELETE", "username": "sys_admin", "archiveObject": { "identifikator": "A-00002", "innhold": null, "navn": "Test 33", "created": "2024-10-15T09:59:10.492+00:00", "created_by": "sys_admin", "updated": "2024-10-15T09:59:10.492+00:00", "updated_by": "sys_admin", "kasskode": null, "arkivid": "1ff03756-8adc-11ef-9eb5-4b014e904ddc", "merknad": null, "sluttdato": null, "startdato": null, "presisjon": null, "omfang": null, "omfangenhet": null, "ordningsgrad": null, "ordnetav": null, "ordnetdato": null, "katalogisering": null, "katalogmedium": null, "katalogreferanse": null, "asta5urn": null, "depotstatus": null, "bevarinsgstid": null, "kassasjonsar": null, "ispublishenabled": null, "fargebilde": null, "bunnmateriale": null, "teknikk": null, "fysisktilstand": null, "beskrivelse": null, "planlagtkonservering": null, "bredde": null, "hoyde": null, "malestokk": null, "teknikkmerknad": null, "lokasjon": null, "arkivlast": null, "date": null } }, ... ]
archiveObjec
in response is the content affected by this event