Skip to content
Last updated

PERS SDK - v2.3.26 / Exports / NotificationApi

Class: NotificationApi

Notification API - Low-level API client for the notification inbox

Backend routes (src/notification/infrastructure/notifications.controller.ts):

  • GET /notifications/channel-id - Besu channelId for real-time WS binding
  • GET /notifications - paginated inbox
  • GET /notifications/unread-count - unread badge count
  • PATCH /notifications/:id/read - mark as read
  • DELETE /notifications/:id - delete
  • POST /notifications/send - direct push (BUSINESS → USER, TENANT → USER|BUSINESS)

Use NotificationService or NotificationManager for higher-level operations

Table of contents

Constructors

Methods

Constructors

constructor

new NotificationApi(apiClient): NotificationApi

Parameters

NameType
apiClientPersApiClient

Returns

NotificationApi

Defined in

notification/api/notification-api.ts:26

Methods

getChannelId

getChannelId(): Promise<null | string>

Get the Besu channelId for the authenticated account (auto-provisioned on first call). GET /notifications/channel-id

Returns

Promise<null | string>

Defined in

notification/api/notification-api.ts:32


list

list(options?): Promise<PaginatedResponseDTO<NotificationDTO>>

List the authenticated account's notification inbox (paginated). GET /notifications

Parameters

NameType
options?NotificationQueryOptions

Returns

Promise<PaginatedResponseDTO<NotificationDTO>>

Defined in

notification/api/notification-api.ts:41


getUnreadCount

getUnreadCount(): Promise<NotificationUnreadCountDTO>

Get unread notification count. GET /notifications/unread-count

Returns

Promise<NotificationUnreadCountDTO>

Defined in

notification/api/notification-api.ts:58


markAsRead

markAsRead(id): Promise<NotificationDTO>

Mark a notification as read. PATCH /notifications/:id/read

Parameters

NameType
idstring

Returns

Promise<NotificationDTO>

Defined in

notification/api/notification-api.ts:66


delete

delete(id): Promise<void>

Delete a notification. DELETE /notifications/:id

Parameters

NameType
idstring

Returns

Promise<void>

Defined in

notification/api/notification-api.ts:74


send

send(dto): Promise<NotificationDTO>

Send a direct notification (BUSINESS → USER, or TENANT → USER|BUSINESS). POST /notifications/send

Parameters

NameType
dtoSendNotificationDTO

Returns

Promise<NotificationDTO>

Defined in

notification/api/notification-api.ts:82