Audit Trail API

Introduction

The Audit Trail API allows you to list all records present in the Audit Trail database. This API provides options to filter, sort, and paginate the returned results, making it easier to retrieve and analyze audit data.

Plugin information

The Audit Trail API is a crucial component for monitoring and tracking system activities within your Joget applications. It enables administrators and developers to query audit records programmatically.

Get started

Prerequisites

  • You must have access to a Joget environment where the Audit Trail API is enabled.
  • Basic knowledge of RESTful API usage and JSON format.

Where to get the plugin

The Audit Trail API functionality is built into Joget; no separate plugin is required.

How to install

The Audit Trail API is pre-installed with Joget. No additional installation steps are necessary.

How to use it

  1. Drag and drop the Audit Trail API from the Palette to the Canvas.
  2. Select the endpoints

 

List of API Endpoint

List audit trails

List all records present in the Audit Trail database table by default. Able to filter or sort the returned results via parameters.

URL: /auditTrails

HTTP Method: GET

Query String Parameters
Parameter Description
search

Filters the response by querying the search terms for:

  • username
  • java class
  • java method
  • output message

Similar to the LIKE operator for database querying.

dateFrom

Filters the response from the specified date and time.

Format: YYYY-MM-DD hh:mm:ss (e.g: 2019-08-26 00:00:00)

dateTo

Filters the response to the specified date and time.

Format: YYYY-MM-DD hh:mm:ss (e.g: 2019-08-27 23:59:59)

sort Audit trails data column to sort. Must be used in conjunction with sortDescending parameter.
sortDescending Sort the specified sort parameter value in ascending or descending order. Expect a boolean value. Must be used in conjunction with sort parameter.
startOffset Starting position of records to start query. Expect an integer.
pageSize Number of results to return. Expect an integer.
Sample Response
[
  {
    "id": "4028e381697072b901697073acec0000",
    "username": "roleAnonymous",
    "appId": "appcenter",
    "appVersion": "1",
    "timestamp": "Mar 12, 2019 1:50:22 PM",
    "clazz": "org.joget.apps.workflow.security.WorkflowAuthenticationProvider",
    "method": "authenticate",
    "message": "Authentication for user admin (0:0:0:0:0:0:0:1) : true"
  },
    .....
]
Created by Julieth Last modified by Aadrian on Dec 03, 2024