Помощен център Notification inbox

Notification inbox

Returns the notifications sent to a user within your application — the data behind an in-app “Messages” screen.

GET /api/push/notifications?externalUserId=operator-497&limit=50&offset=0
X-Push-App-Key: <application key>

Query parameters

ParameterRequiredNotes
externalUserIdyesThe namespaced user id used at registration.
limitnoPage size.
offsetnoPagination offset.
fromnoStart of an ISO-8601 date range.
tonoEnd of an ISO-8601 date range.
statusnoFilter by notification status.

Normalise the response before using it

The response may be a bare array or a paged envelope. An earlier build passed the raw body straight to .filter, and a non-array took the whole notification centre down with it.

const toArray = (data: any) =>
    Array.isArray(data) ? data
    : Array.isArray(data?.items) ? data.items
    : Array.isArray(data?.data) ? data.data
    : Array.isArray(data?.notifications) ? data.notifications
    : Array.isArray(data?.result) ? data.result
    : [];