Consuming notifications

The Atoti Notification Service provides a REST API you can use to establish a connection with the server to receive Server-Sent Events (SSE) and perform actions on the notifications. If you are using a custom EventSource client to consume notifications from the service, you can use the service’s REST endpoints to interact with the service.

All endpoints are prefixed with notification-service/sse/v1/notifications:

  • /subscribe (GET): Establishes a connection with the server to receive notifications. The response is an SSE stream of notifications.
  • /execute-action (POST): Executes an action on notifications. The request body should be a NotificationActionPayload object. Example:
{
    "notificationIds": [1, 2, 3],
    "actionType": "MARK_READ"
}
  • /emitters/close (POST) - Closes all open connections to the server. Connections are automatically closed after a specified timeout (see notification-service.emitter-timeout property in Configuration Properties) or when a user logs out/closes the browser, but this endpoint can be used to manually close all connections.