Get audit logs by user id (getAuditLogsByUserId)
Returns a page of audit logs related to the actions of targeted user. For example, RPC call to a particular device, or alarm acknowledgment for a specific device, etc. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details.
Available for users with 'TENANT_ADMIN' authority.
Path parameters
A string value representing the user id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'
Query parameters
Maximum amount of entities in a one page
Sequence number of page starting from 0
The case insensitive 'substring' filter based on one of the next properties: entityType, entityName, userName, actionType, actionStatus.
Property of audit log to sort by. See the 'Model' tab of the Response Class for more details. Note: entityType sort property is not defined in the AuditLog class, however, it can be used to sort audit logs by types of entities that were logged.
Sort order. ASC (ASCENDING) or DESC (DESCENDING)
The start timestamp in milliseconds of the search time range over the AuditLog class field: 'createdTime'.
The end timestamp in milliseconds of the search time range over the AuditLog class field: 'createdTime'.
A String value representing comma-separated list of action types. This parameter is optional, but it can be used to filter results to fetch only audit logs of specific action types. For example, 'LOGIN', 'LOGOUT'. See the 'Model' tab of the Response Class for more details.
Response
OK
Example response
{
"data": [
{
"id": {
"id": "784f394c-42b6-435a-983c-b7beff2784f9"
},
"createdTime": 1609459200000,
"tenantId": {
"id": "784f394c-42b6-435a-983c-b7beff2784f9",
"entityType": "TENANT"
},
"customerId": {
"id": "784f394c-42b6-435a-983c-b7beff2784f9",
"entityType": "CUSTOMER"
},
"entityId": {
"id": "784f394c-42b6-435a-983c-b7beff2784f9",
"entityType": "DEVICE"
},
"entityName": "Thermometer",
"userId": {
"id": "784f394c-42b6-435a-983c-b7beff2784f9",
"entityType": "USER"
},
"userName": "tenant@thingsboard.org",
"actionType": "ADDED",
"actionData": {},
"actionStatus": "SUCCESS"
}
]
}