Skip to main content

OMS Audit Events Service

The OMS Audit Events Service contains records of model changes and various events that occur within the OMS. This service is responsible for retrieving these event logs from the OMS.

GET List OMS Audit Events

This service is used to retrieve list of audit events from OMS.

Path: /api/v1/oms/settings/audit_events/

Payload

No payload is required.

Filters

ParameterData TypeInDescription
urlstringquery paramFilters the event url
content_typeintquery paramFilters the event object content type
object_idintquery paramFilters the event object
start_datedatetimequery paramFilters the event start date
end_datedatetimebodyFilters the event end date

Example Request

To run this service, a GET request should be sent to /api/v1/oms/settings/audit_events/ endpoint.

Here's an example of how to make the request in python:

import requests

url = "https://{oms_base_url}/api/v1/oms/settings/audit_events/?url=https://example-url.com&content_type=1"
api_token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"

headers = {
'Accept': 'application/json',
'Authorization': 'Token {}'.format(api_token)
}

response = requests.request("get", url, headers=headers)

print(response.text)

Example Response (201 CREATED)

In a successful response with a status code of 200 OK, the response body contains list of audit event objects.

ParameterData TypeDescription
uuiduuidUnique ID of the audit event
timestampdatetimeTimestamp of the event
remote_addrstringIf event has remote address, this parameter shows the remote address of the event
urlstringURL of the event
query_paramsobjectIf event has query params, this parameter shows the query params of the event
post_dataobjectIf event has post data, this parameter shows the post data of the event
headersobjectHeaders of the event
object_idintRelated object ID of the event
contentobjectContent of the event
userintIf event is triggered by user, this parameter shows the user of the event.
content_typeintRelated object content type of the event
    {
"count": 100,
"next": "https://demo.omnitron.akinon.net/api/v1/oms/settings/audit_events/?page=2",
"previous": null,
"results": [
{
"uuid": "410237f7-2a6f-48de-9c41-b988326d7607",
"timestamp": "2023-10-16T09:00:00.929094Z",
"remote_addr": null,
"url": "https://example.com",
"query_params": {},
"post_data": {},
"headers": {},
"object_id": 859,
"content": {
"new_data": {
"quantity": 2.0
},
"old_data": {
"quantity": 1.0
},
},
"user": null,
"content_type": 41
}
]
}