Child pages
  • WHM API 1 - Paginate Output

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

Excerpt

You can use additional variables to paginate WHM API 1 output.


Note
titleNotes:
  • You can test WHM API 1 functions in WHM's API Shell interface (Home >> Development >> API Shell). Click Show Sort/Filter/Paginate Options to display the additional text boxes.
  • We strongly recommend that you use pagination for Mail Delivery Report (MDR) functions.

Paginate output

WHM API 1 pagination uses four basic variables:

VariableTypeDescriptionPossible values
api.chunk.enableBooleanWhether to enable pagination.
  • 1 — Enable pagination.
  • 0 — Disable pagination.
api.chunk.sizeintegerThe number of records to display in a single page.

An integer value that represents a number of records.

For example, to display ten records on a page, pass in an api.chunk.size value of 10.

api.chunk.startinteger

The first record to display.

An integer value that represents a number of records.

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

Note
titleNote:

This variable is 1-indexed rather than 0-indexed. For example, to start with the first record, specify a value of 1 rather than a value of 0


Examples

The following example function calls execute the listaccts function, begin output at the third record, and display five records in total on the page:

Localtab Group


Localtab
activetrue
titleJSON API


Code Block
languagetext
/json-api/listaccts?api.version=1&api.chunk.size=5&api.chunk.start=3&api.chunk.enable=1



Localtab
titleXML API

Multiexcerpt include
MultiExcerptNameShort Macro
PageWithExcerptLIB:_XMLDeprecated

Code Block
languagexml
/xml-api/listaccts?api.version=1&api.chunk.size=5&api.chunk.start=3&api.chunk.enable=1



Localtab
titleCommand Line


Code Block
languagebash
whmapi1 listaccts api.chunk.enable=1 api.chunk.size=5 api.chunk.start=3