Get notifications (getNotifications)
Returns the page of notifications for current user.
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 any authorized user.
WebSocket API:
There are 2 types of subscriptions: one for unread notifications count, another for unread notifications themselves.
The URI for opening WS session for notifications: /api/ws/plugins/notifications.
Subscription command for unread notifications count:
{
"unreadCountSubCmd": {
"cmdId": 1234
}
}
To subscribe for latest unread notifications:
{
"unreadSubCmd": {
"cmdId": 1234,
"limit": 10
}
}
To unsubscribe from any subscription:
{
"unsubCmd": {
"cmdId": 1234
}
}
To mark certain notifications as read, use following command:
{
"markAsReadCmd": {
"cmdId": 1234,
"notifications": [
"6f860330-7fc2-11ed-b855-7dd3b7d2faa9",
"5b6dfee0-8d0d-11ed-b61f-35a57b03dade"
]
}
}
To mark all notifications as read:
{
"markAllAsReadCmd": {
"cmdId": 1234
}
}
Update structure for unread notifications count subscription:
{
"cmdId": 1234,
"totalUnreadCount": 55
}
For notifications subscription:
- full update of latest unread notifications:
{
"cmdId": 1234,
"notifications": [
{
"id": {
"entityType": "NOTIFICATION",
"id": "6f860330-7fc2-11ed-b855-7dd3b7d2faa9"
},
...
}
],
"totalUnreadCount": 1
}
- when new notification arrives or shown notification is updated:
{
"cmdId": 1234,
"update": {
"id": {
"entityType": "NOTIFICATION",
"id": "6f860330-7fc2-11ed-b855-7dd3b7d2faa9"
},
# updated notification info, text, subject etc.
...
},
"totalUnreadCount": 2
}
- when unread notifications count changes:
{
"cmdId": 1234,
"totalUnreadCount": 5
}
Query parameters
Maximum amount of entities in a one page
Sequence number of page starting from 0
Case-insensitive 'substring' filter based on notification subject or text
Property of entity to sort by
Sort order. ASC (ASCENDING) or DESC (DESCENDING)
To search for unread notifications only
Delivery method
Response
OK
Example response
{
"data": [
{
"requestId": {
"id": "784f394c-42b6-435a-983c-b7beff2784f9",
"entityType": "NOTIFICATION_REQUEST"
},
"recipientId": {
"id": "784f394c-42b6-435a-983c-b7beff2784f9",
"entityType": "USER"
},
"additionalConfig": {},
"info": {
"dashboardId": {
"id": "784f394c-42b6-435a-983c-b7beff2784f9",
"entityType": "DASHBOARD"
},
"stateEntityId": {
"id": "784f394c-42b6-435a-983c-b7beff2784f9",
"entityType": "DEVICE"
}
},
"id": {
"id": "784f394c-42b6-435a-983c-b7beff2784f9",
"entityType": "NOTIFICATION"
},
"createdTime": 1746028547220
}
]
}