Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

RESTful API Pagination Example

Some organizations have inventories with thousands of APs. This can be challenging when you want to view them all with an API GET request, because by default, the response will be returned without pagination on a single page. You can enable pagination to the returned data by adding HTTP header parameters for X-Page-Limit, X-Page-Page and X-Page-Total to the API GET request. These help you to know if you are getting all of the available entries or if you need to query the next pages.

The X-Page-Limit defines the maximum number of results per page. The limit is 100 by default, and the maximum value is 1000. However, there are some exceptions to this.

The X-Page-Page defines the maximum number of page results.

The X-Page-Total defines the total number of entries in the list. The total will depend on what you are looking at and how many entries are in the list.

To adjust any of this information, the query parameters can be added to the end of the web URL for the API interface you are using. Depending on the API call, you may need to instead add the parameters to the end of the "next" URL that is generated and sent in the response body (should a "next" exist).

In the following example, adding limit=2&page=47 would adjust the X-Page-Limit and X-Page-Page parameters.

The example below shows the format of a GET request that includes pagination:

The response you receive from Mist when making the request in the Django web interface, will look like this:

Refer to our API document for more information on usage: https://api.mist.com/api/v1/docs/Overview#query (Juniper Mist login required)