Audit Log
The endpoint AuditLog (https://dataloy-systems.stoplight.io/docs/dataloyModel/model/schemas/audit-log) can be used to get all changes of any object in the data model.
To get the changes of a given object with key KEY_X:
{BASE_URL}/ws/rest/AuditLog?filter=source(EQ)KEY_X
In the same request send the HTTP Header parameter fields with this JSON
{"objectName":"*","attributeName":"*","actionTime":"*","entryText":"*","source":"*","newValue":"*","oldValue":"*","isChangedByUser":"*","action":{"actionName":"*"},"user":{"userName":"*"}}The response will be an array of AuditLog objects:
[
{
"key": 8345668,
"self": "https://dev.dataloy.com/ws/rest/AuditLog/8345668",
"objectName": "Voyage",
"attributeName": "ladenConsumption",
"source": 8336217,
"user": {
"key": 3689599,
"self": "https://dev.dataloy.com/ws/rest/User/3689599",
"userName": "Andrea Biasillo"
},
"actionTime": "2023-03-03T19:23:00",
"entryText": "Field update: ladenConsumption",
"isChangedByUser": true,
"newValue": "83.29555785678073",
"oldValue": "67.03034584820784",
"action": {
"key": 1000009,
"self": "https://dev.dataloy.com/ws/rest/Action/1000009",
"actionName": "EDIT"
}
},
{
"key": 8345669,
"self": "https://dev.dataloy.com/ws/rest/AuditLog/8345669",
"objectName": "Voyage",
"attributeName": "co2Laden",
"source": 8336217,
"user": {
"key": 3689599,
"self": "https://dev.dataloy.com/ws/rest/User/3689599",
"userName": "Andrea Biasillo"
},
"actionTime": "2023-03-03T19:23:00",
"entryText": "Field update: co2Laden",
"isChangedByUser": true,
"newValue": "267.045558488839",
"oldValue": "214.89928878935433",
"action": {
"key": 1000009,
"self": "https://dev.dataloy.com/ws/rest/Action/1000009",
"actionName": "EDIT"
}
},
{
"key": 8345670,
"self": "https://dev.dataloy.com/ws/rest/AuditLog/8345670",
"objectName": "Voyage",
"attributeName": "tcResultDay",
"source": 8336217,
"user": {
"key": 3689599,
"self": "https://dev.dataloy.com/ws/rest/User/3689599",
"userName": "Andrea Biasillo"
},
"actionTime": "2023-03-03T19:23:00",
"entryText": "Field update: tcResultDay",
"isChangedByUser": true,
"newValue": "4877.341669917246",
"oldValue": "6227.220974136807",
"action": {
"key": 1000009,
"self": "https://dev.dataloy.com/ws/rest/Action/1000009",
"actionName": "EDIT"
}
},
{
"key": 8345671,
"self": "https://dev.dataloy.com/ws/rest/AuditLog/8345671",
"objectName": "Voyage",
"attributeName": "ballastConsumption",
"source": 8336217,
"user": {
"key": 3689599,
"self": "https://dev.dataloy.com/ws/rest/User/3689599",
"userName": "Andrea Biasillo"
},
"actionTime": "2023-03-03T19:23:00",
"entryText": "Field update: ballastConsumption",
"isChangedByUser": true,
"newValue": "42.7633723560667",
"oldValue": "42.90031887514484",
"action": {
"key": 1000009,
"self": "https://dev.dataloy.com/ws/rest/Action/1000009",
"actionName": "EDIT"
}
]The endpoint AuditLog can be used to know all the objects that have been deleted:
/ws/rest/AuditLog?filter=action.actionName(EQ)REMOVE
in combitation with other filters and the HTTP Header parameter fields with this value:
{"entryText":"*","user":"*","actionTime":"*"}
return a response like this one:
where in the field entryText there is the object type and object key that has been deleted-
Was this helpful?