I'm using API rest for Audit.
I don't get the correct filter for filtering by type and action.
Using the endpoint:
/alfresco/api/-default-/public/alfresco/versions/1/audit-applications/alfresco-access/audit-entries
I'm testing with the examples in the api-explorer page:
where=(valuesKey='/alfresco-access/transaction/action' and valuesValue='DELETE')
where=(createdByUser='jbloggs')
Each one works individually but do not combinated,
For example:
Solved! Go to Solution.
The Audit API simply does not support supplying more than one filter using valuesKey/valuesValue. The API documentation states that
The list can be filtered by one or more of: - createdByUser person id - createdAt inclusive time period - id inclusive range of ids - valuesKey audit entry values contains the exact matching key - valuesValue audit entry values contains the exact matching value
Linguistically, this can be understood in different ways. Unfortunately for your use case, the interpretation is not that you can use either of these fields multiple times, rather that you can use one of those fields or multiple of them, but each field only once.
Looking at the implementation, the documentation also seems to contain a lie/omission: It is not possible to use valuesKey or valuesValue without the other
The Audit API simply does not support supplying more than one filter using valuesKey/valuesValue. The API documentation states that
The list can be filtered by one or more of: - createdByUser person id - createdAt inclusive time period - id inclusive range of ids - valuesKey audit entry values contains the exact matching key - valuesValue audit entry values contains the exact matching value
Linguistically, this can be understood in different ways. Unfortunately for your use case, the interpretation is not that you can use either of these fields multiple times, rather that you can use one of those fields or multiple of them, but each field only once.
Looking at the implementation, the documentation also seems to contain a lie/omission: It is not possible to use valuesKey or valuesValue without the other
@afaust Thanks for reply.
Maybe can I do the query direct in the database? Can you explain me?
Best regards.
I really can't explain much more than what you can read in the sources for direct SQL queries. Due to the significant normalisation of keys/values, queries can become quite complex pretty fast - which is one reason why Alfresco themselves did not bother to support more than one key-value pairing as selection criteria.
@afaust thanks for your reply.
Hi. @gregorio2501
Thanks for accepting the answer as a solution.
Cheers,
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.