POST
Description : retrieve requests logs of a certain type for (a) given device(s) or all the devices.
Accepts : JSON
Returns : JSON
Body of the request
{
"type": "int",
"request_type": "int | None",
"device_ids": "list[str] | None",
"limit": "int",
"offset": "int",
"sort": "str",
"order": "int"
}
Body parameters
- type : the desired type of log to be fetched (
0requests history,1for licenses history)Example :
0 - request_type : the desired type of request history log if specified (
0for time requests,1for licenses requests)Example :
0 - device_ids : the list of devices for which the logs must be retrieved
Example :
["11a..", "25fe..", ..] - limit : the number of logs to be returned by the request.
Example :
20 - offset : the index from which the data must be fetched from the database results.
Example :
20 - sort : the column by which the data must be ordered (default:
timestamp).Example :
device_id - order : the direction in which the data must be sorted (default:
desc).Example :
ASC,DESC
The request_type parameter can only be used with type = 0.
Responses
Depending of the validity of the request, different responses/status codes will be returned.
HTTP 200
{
"result": {
"items": "list",
"count": "int",
"limit": "int",
"offset": "str",
}
}
Response parameters
- items : the retrieved logs.
Example :
[{"timestamp":"1751890500", "device_id":"11a..", "src_ip":"127.0.0.1"}, ..],[{"timestamp":"1751890543", "device_id":"11a..", "license_expiration":"1751890500"}, ..] - count : the total number of stored logs in order to compute pagination.
Example :
80 - limit : the number of logs to be returned by the request.
Example :
20 - offset : the index from which the data must be fetched from the database results.
Example :
20
HTTP 422, 501
{
"result": "list[str] | str"
}
Response parameters
- result : the error code.
Example :
Invalid body,Error