Pagination and sorting
Page through and sort list results in V2 and V1.
V2 pagination
Every V2 list endpoint is paginated by page. limit sets the page size (default 10, maximum 100) and offset is the page number, starting at 0. It is not a record offset.
| Request | Returns |
|---|---|
GET /api/v2/alerts | Records 1 to 10 |
GET /api/v2/alerts?offset=1 | Records 11 to 20 |
GET /api/v2/alerts?limit=100 | Records 1 to 100 |
GET /api/v2/alerts?limit=100&offset=1 | Records 101 to 200 |
List responses include a metadata object with limit, previous and next.
V2 sorting
Use sortDir (asc or desc) with the sort field parameter for that resource. Most resources use sortCol. Groups, Users and Workflows use sortBy.
| Resource | Sort field parameter | Supported sort fields | Example |
|---|---|---|---|
| Alerts | sortCol | AlertId (default), CreatedDate, ClosedDate | /api/v2/alerts?sortDir=desc&sortCol=AlertId |
| Escalation Policies | sortCol | EscalationRule (default), NotificationType, Priority | /api/v2/escalation_policies?sortDir=asc&sortCol=Priority |
| Groups | sortBy | GroupName (default), Description | /api/v2/groups?sortDir=asc&sortBy=GroupName |
| Inbound Integrations | sortCol | Name (default), Sequence, EscalationPolicy, Recipients | /api/v2/integrations/inbound?sortDir=asc&sortCol=name |
| Outbound Integrations | n/a (always alphabetical) | n/a | /api/v2/integrations/outbound?sortDir=desc |
| Users | sortBy | UserName (default), LastName, FirstName, LastLoginDate, Roles | /api/v2/users?sortBy=LastLoginDate&sortDir=asc |
| Workflows | sortBy | Workflow (default), WorkflowType, Scheduled | /api/v2/workflows?sortBy=WorkflowType&sortDir=desc |
V1 pagination (legacy)
V1 paginates the Alert object only, with Limit and Offset. Offset must be an exact multiple of Limit or pagination will not work.
| Request | Result |
|---|---|
GET /api/alert?APIKey=<KEY>&Limit=100 | First 100 alerts |
GET /api/alert?APIKey=<KEY>&Limit=100&Offset=100 | Next 100 alerts |
GET /api/alert?APIKey=<KEY>&Limit=100&Offset=200 | Third 100 alerts |
GET /api/alert?APIKey=<KEY>&Limit=100&Offset=10 | Fails: 10 is not a multiple of 100 |