Last updated

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": []
}
hasResourcesboolean

Indicates whether the query would return any objects with no query parameters.

totalResourcesinteger

The count of the total objects that match the provided query parameters.

totalPagesinteger

The page count of the queried resources.

pageSizeinteger

The batch size of objects returned.

currentPageinteger or null

Indicates the current page being queried. Null if the total resources is 0.

previousPageinteger or null

Indicates the previous page of the page being queried. Null if the total resources is 0 or if currentPage is 1.

nextPageinteger or null

Indicates the previous page of the page being queried. Null if the total resources is 0 or if currentPage is equal to totalPages.

resultsarray<object>

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": []
}
previousPagestring or null

The URL to the previous page of results.

nextPagestring or null

The URL to the next page of results.

resultsarray<object>

All returned resources for the queried page.