latestOpenAPI 3.1.0Apache License Version 2.02026-08-17498525913.3 KB

40169ccdec5c

notification-controller

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
}
get/api/notifications

Query parameters

pageSizeinteger required

Maximum amount of entities in a one page

pageinteger required

Sequence number of page starting from 0

textSearchstring

Case-insensitive 'substring' filter based on notification subject or text

sortPropertystring

Property of entity to sort by

sortOrderstring

Sort order. ASC (ASCENDING) or DESC (DESCENDING)

unreadOnlyboolean

To search for unread notifications only

deliveryMethod'WEB' | 'MOBILE_APP'

Delivery method

Response

OK

totalPagesinteger

Total number of available pages. Calculated based on the 'pageSize' request parameter and total number of entities that match search criteria

totalElementsinteger

Total number of elements in all available pages

hasNextboolean

'false' value indicates the end of the result set

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
    }
  ]
}