Responses that return lists of objects are paginated. Pagination breaks down a large response into smaller responses called pages that the caller can step through to read all of the data. EncompassFi paginates responses to ensure that response sizes are kept small and response times remain low.
EncompassFi provides two schemas for pagination depending on the resources being queried: the API Query Response and Api List Response.
API Query Response
This is the default response scheme for queried results containing multiple resources. Pages can be navigated by sending the page
and pageSize
query parameters in the HTTP request.
{ "hasResources": boolean, "totalResources": number, "totalPages": number, "pageSize": number, "currentPage": number | null, "previousPage": number | null, "nextPage": number | null, "results": [] }
Indicates whether the query would return any objects with no query parameters.
The count of the total objects that match the provided query parameters.
The page count of the queried resources.
The batch size of objects returned.
Indicates the current page being queried. Null
if the total resources is 0.
Indicates the previous page of the page being queried. Null
if the total resources is 0 or if currentPage
is 1.
Indicates the previous page of the page being queried. Null
if the total resources is 0 or if currentPage
is equal to totalPages
.
All returned resources for the queried page.
API List Response
Some query endpoints fetch data from multiple sources or return resources that are generated on demand. For these endpoints, an API List Response is used. Pages can be navigated by creating an HTTP GET request to the provided URLs in previousPage
or nextPage
. Endpoints that use the API List Response schema will be marked as such.
{ "previousPage": string | null, "nextPage": string | null, "results": [] }
The URL to the previous page of results.
The URL to the next page of results.
All returned resources for the queried page.