Skip to content

@mbanq/core-sdk-js v0.50.0


@mbanq/core-sdk-js / commands / GetSubscribers

Function: GetSubscribers()

GetSubscribers(params): Command<{ params: { activeOnly?: boolean; limit?: number; offset?: number; orderBy?: "name" | "id" | "type" | "target"; sortOrder?: "ASC" | "DESC"; }; }, { pageItems: object[]; totalFilteredRecords: number; }>

Defined in: src/commands/rest/notification.ts:194

Retrieves a list of all subscribers with optional filtering and pagination.

Parameters

params

Query parameters for filtering, pagination, and sorting

activeOnly?

boolean = ...

Filter to return only active subscribers

limit?

number = ...

Maximum number of records to return. Set to 0 to fetch all records

offset?

number = ...

Pagination offset (number of records to skip)

orderBy?

"name" | "id" | "type" | "target" = ...

Field to order results by. Values: id, name, type, target

sortOrder?

"ASC" | "DESC" = ...

Sort order direction. Values: ASC, DESC

Returns

Command<{ params: { activeOnly?: boolean; limit?: number; offset?: number; orderBy?: "name" | "id" | "type" | "target"; sortOrder?: "ASC" | "DESC"; }; }, { pageItems: object[]; totalFilteredRecords: number; }>

A Command that when executed returns the list of subscribers

Example

typescript
const getSubscribersCmd = GetSubscribers({
  offset: 0,
  limit: 10,
  orderBy: 'name',
  sortOrder: 'ASC',
  activeOnly: true
});
const result = await getSubscribersCmd.execute(config);
console.log(result.pageItems);

Released under the MIT License.