Skip to content

Access to audit data via API

Introduction

Audit logs can be accessed by specially authorised and trained users, including through APIs (RESTful APIs) developed according to the OData v4.0 standard. By default, the elements are ordered with respect to the dateTimeUtc property in descending order, from most recent to least recent.

Note The service returns up to a maximum of 10,000 items.

Certain conditions are required to use this consultation mode.

Authorisation

To be able to use this specific API, the user must have the 0001286 function enabled at least in read mode.

APIs for data processing

STATUS SWAGGER
ACTIVE -
FORMAT ROOT ENDPOINT
OData <api root>/audit/v1/dataprocessing

The URLs for obtaining the audit data on data processing are provided below:

URL Description
/audit/v1/dataprocessing/ Service displayed
/audit/v1/dataprocessing/$metadata Returns the following metadata: - Scheme - EntityType - EntityContainer - EntitySet In particular, data types are specified for all entity properties and, in the case of changes, the additionalFields property is present
/audit/v1/dataprocessing/ Returns the name and description of all the application’s data processing.
/audit/v1/dataprocessing/ Returns all occurrences of the selected data process (ELABORATION_CODE).

The additionalFields property shows the data changed during data processing; it lists a collection of values, each of which has three properties:

  • field: shows the name of changed data
  • old_ = value before editing
  • new_ = value after editing

Contents of the data returned

By invoking the second endpoint, the following data are returned:

Element Description
oid Elaboration code
dateTimeUtc Date and time performed (format: ISO 8601, UTC)
status Data processing outcome
parts Processing step, if divided into parts (0 = pre-run)
user Executing user
database Execution database
duration Data processing duration (millisec)
client Data processing client
ipClient IP address of the device originating the data processing

These data are followed by the dimensional parameters, if present, together with the relative values.

APIs for managing tables and data

The URLs for obtaining audit data on the management of tables and data are provided below:

URL Description
/audit/v2/datamanagement/ Service displayed
/audit/v2/datamanagement/$metadata Returns the following metadata: - Scheme - EntityType - EntityContainer - EntitySet In particular, the data types of the columns of each table are specified, and the additionalFields property is present in case of changes.
/audit/v2/datamanagement/ Returns the code and description of the edited tables.
/audit/v2/datamanagement/TABLE_CODE Returns all occurrences of the changes in the indicated table (TABLE_CODE)

Contents of the data returned

By invoking the second endpoint, the following data are returned:

Element Description
oid Operation code
dateTimeUtc Date and time edited (format: ISO 8601, UTC)
status Edit outcome
user Executing user
database Execution database
duration Data processing duration (ms)
client Data processing client
ipClient IP address of the device originating the data processing
editType Type of edit (entry, edit or deletion)
factTable Type of table edited: - true = facts table - false = master table
key Physical key of the edited data

This data may be followed by additionalFields properties for each column of the selected table if changes are made:

  • field: shows the name of changed data
  • old_ = value before editing
  • new_ = value after editing

Multi-value properties are aggregated on the same row and separated by a comma.

APIs for database logins

STATUS SWAGGER
ACTIVE -
FORMAT ROOT ENDPOINT
OData <api root>/audit/v1/database

The URLs for obtaining audit data on database logins are provided below:

URL Description
/audit/v1/database/ Service displayed
/audit/v1/database/$metadata Returns the following metadata: - Scheme - EntityType - EntityContainer - EntitySet
/audit/v1/database/CONNECT_TO_DATABASE Returns a list of logins to the various databases.

Contents of the data returned

By invoking the second endpoint, the following data are returned:

Element Description
oid Operation code
dateTimeUtc Date and time of login format: ISO 8601, UTC)
status Operation outcome
user Executing user
database Execution database
duration Data processing duration (ms)
client Data processing client
ipClient IP address of the device that ran the data processing

API for user logins

The URLs for obtaining audit data on user logins are provided below:

URL Description
/audit/v1/user/ Service displayed
/api/audit/v1/user/$metadata Returns the following metadata: - Scheme - EntityType - EntityContainer - EntitySet
/audit/v1/user/LOGIN Returns a list of user logins.

Contents of the data returned

By invoking the second endpoint, the following data are returned:

Element Description
oid Operation code
dateTimeUtc Date and time of login (format: ISO 8601, UTC)
status Operation outcome
user Executing user
client Client used by the user
ipClient IP address of the device that ran the data processing
sessionDuration Session duration (ms), terminated by logout or timed out
timedOut Type of session interruption: - true = session timed out - false = user logout