Many endpoints in the MTOA API return a collection of records. In some cases, we also support the concept of pagination, where instead of returning all of the results in a single response, we return them in smaller sets called pages. This approach allows us to keep the performance high on the server, and also minimizes the size of our responses by breaking them into smaller, more manageable blocks.
When an endpoint supports pagination, it will accept page
and pagesize
query string to allow you to control the paging. The pagesize
parameter represents the number of records to return, while the page
parameter represents the specific page of results for the given pagesize
.
Here’s an example request for returning the first 50 feedback of a service Id via the Feedback (GetByServiceId) endpoint and the pagesize
query string parameter:
GET
/api/v1/feedback/services/{serviceId}?pageSize=50
To retrieve the next 50 records, include page to skip the first 50 records:
GET
/api/v1/feedback/services/{serviceId}?page=2&pageSize=50
Best Practice
The pagesize
you choose can affect the performance of the servers. It is NOT recommended to set the pagesize
to some arbitrarily large number in an effect to circumvent the pagination feature.