Sorting and Pagination

Sorting and pagination are supported for most RocketCOMS APIs that return arrays of resources. You can control sorting and pagination through URL query parameters.

  • Use the sortBy (sort field) and sortDir (sort direction) parameters to specify the sort order.
  • Use the page (page number to return) and pageSize (maximum number of results to return per page) parameters to limit the number of results and keep responses to a reasonable size. For example, to return the first 10 records on the first page, use page=0 and pageSize=10.

The response includes paging information and a content array. The following fields are returned:

page  Page number returned.

total  Total number of available pages.

pageSize  Number of records per page.

content  Array of JSON objects, such as brands or campaigns, for the requested page number.