Skip to main content

Pagination

For some endpoints, the number of rows returned may be very large, depending on the parameters you pass or even the size of school you are requesting data from. Examples of typical culprits are attendance, assessment or timetable, where it is possible there could be many thousands of rows returned for a single request.

Xporter on Demand implements pagination to allow you to receive the responses in manageable chunks and paginate through the data.

  • Important: Pagination is completely optional. If used, be sure to set sensible production values eg pageSize=1000

There are two additional optional parameters that you can pass when making a request to an Xporter on Demand endpoint:

  • page
  • pagesize

On the Sandbox site we have defaulted the endpoints to return 1 page with a maximum of 25 records, defined by pagesize.

If you were to remove the value for page, then the TryIt site will still return you 25 records, but it will also indicate the PageNumber and PageCount along with the parameter set required to access the next page.

  • Example Request: .../Students/?pageSize=25

This information is return in an additional dataset _pagination_

     "__pagination__": [
{
"PageSize": 25,
"PageNumber": 1,
"PageCount": 41,
"RowCount": 1017,
"NextPage": "?page=2&pageSize=25"
}
]

Your next call to the endpoint would use the NextPage value:

  • Example Request: .../Students/?page=2&pageSize=25

If you are using changedRows, the change set is calculated prior to pagination and you can simply include your changeset parameter in the same call

  • Example Request: .../Students/?changedRows=%2A&pageSize=25