Using /api/v2/audits/query

Greetings:
Looking for some guidance on the /api/v2/audits/query API.

From the API explorer, it seems it should only need

{
"serviceName": "Datatables",
"interval": "2024-06-13T00:00:00/2024-06-14T00:00:00",
"sort": [
{
"name": "Timestamp",
"sortOrder": "descending"
}
],
"filters": [
{
"property": "Action",
"value": "Update",
}
]
}

Yet , to attempt to POST this,

  • I get

Invoke-RestMethod : {"message":"IllegalQueryException [When supplying an action you must also supply
entityType]","code":"bad.request","status":400,"contextId":"c8641515-bf17-4321-bd07-963a1e0765ad","details":[],"errors":[]}

Where should the entityType be included (e.g. Row) to get a nice report on what Rows were updated for datatables for a time period? Had previously "Use[d] /api/v2/audits/query/servicemapping endpoint for a list of valid values" to determine Datatables was a service.

Thanks
-Pete

Hi @Colasacco_Pete ,

You can use the following:
{
"serviceName": "Datatables",
"interval": "2024-06-14T00:00:00/2024-06-15T00:00:00",
"filters": [
{
"property": "EntityType",
"value": "Row"
},
{
"property": "Action",
"value": "Update"
}
],
"sort": [
{
"name": "Timestamp",
"sortOrder": "ascending"
}
]
}

Once you get the output you can use the id of the output in the API
/api/v2/audits/query/{transactionId}/results and get the details of what you want to see on what changes were made.

@siddd0542 - Exactly! This worked perfectly! Thank you for answering this!

Regards
-Pete

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.