Last updated 2 months ago

Introduction

You can use special variables to display UAPI output data in multiple pages (pagination). When you use pagination, the function's output's metadata includes the following hash of pagination control information:

paginate": {
    "total_pages": 1,
    "total_results": 1,
    "current_page": 1,
    "results_per_page": 100,
    "start_result": "1"
}

Pagination variables

UAPI pagination uses four basic variables:

api.paginate

Whether to enable pagination.

  • 1 — Enable pagination.
  • 0 — Disable pagination.

api.paginate_start

The first record to display. A nonnegative integer value that represents a number of records.

For example, begin the page's list of records with the fifth record, pass in an api.paginate_start value of 5.

api.paginate_size

The number of records to display.

A nonnegative integer value that represents a number of records.

For example, to display ten records on the page, pass in an api.paginate_size value of 10.

api.paginate_page

The page of results to display. A nonnegative integer value that represents which page of results to display.

For example, to display the second page of records, pass in an api.paginate_page value of 2.