Skip to main content

Pagination

Basics and examples of pagination in Proactis APIs

The Proactis API uses a simple set of query parameters on most of its endpoints to facilitate paging through large amounts of data.

Request

Our endpoints which return multiple results are paged. If you're calling these endpoints, you will need to supply a pageNumber query parameter. You can configure the size of each page by using the pageSize query parameter.

A typical request will have the following properties:

  • pageNumber : This is the page number that you would like to have displayed. The default page is 0.
  • pageSize : You can define the number of the results you would like to have displayed on one page. The default page size is 25, while the maximum page size can be set to 50.

Response

A typical response will have the following properties:

  • pageNumber: Current page number
  • pageSize: Specified number of results
  • totalElements: Total number of records in the result set
  • content: An array of the specified resources

You can use the totalElements and pageSize to calculate the number of pages that will be required to retrieve all of the available data.

Note: totalElements returns the number of results after applying any filter you've specified in the request. For example: if there are 100 suppliers in total, with 50 of them online, then calling the supplier endpoint with the query online=true would return "totalElements": 50 rather than "totalElements": 100.

Example

GET /suppliers/v1/{domainId}?&pageNumber=0&pageSize=2&online=true

Sample response
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:page xmlns:ns2="http://api.proactis.com/common">
<ns2:pageNumber>0</ns2:pageNumber>
<ns2:pageSize>2</ns2:pageSize>
<ns2:totalElements>50</ns2:totalElements>
<ns2:content>
<supplier>
<id>3ede7e6d9d0f45578e6cdc76</id>
<lastModified>2023-07-01T11:34:02+01:00</lastModified>
<name>Proactis</name>
<number>SUP8305</number>
<online>true</online>
</supplier>
<supplier>
<id>HdYKA6KzrYoAAAGBJ4AAe2cf</id>
<lastModified>2022-06-15T11:28:46Z</lastModified>
<name>Supplier</name>
<number>SUP8721</number>
<online>true</online>
</supplier>
</ns2:content>
</ns2:page>