# Pagination Guide
Many endpoints in Civillo support pagination, allowing you to retrieve results in smaller, manageable chunks.
# Query Parameters
Use the following query parameters to control pagination:
Parameter | Type | Description |
---|---|---|
pageSize | Integer | The number of items to return per page. Default is 50. |
pageNumber | Integer | The page number to retrieve. Starts from 1. |
# Example
To retrieve the first 10 items:
GET /api/items?pageSize=10&pageNumber=1
To retrieve the next 10 items (items 11-20):
GET /api/items?pageSize=10&pageNumber=2
# Example Response
{
"pageNumber": 1,
"pageSize": 50,
"totalCount": 100,
"totalPages": 2,
"items": [
{
"id": "1",
"name": "Example Item 1"
},
{
"id": "2",
"name": "Example Item 2"
}
// ... more items ...
]
}
# Notes
- If
pageSize
is not specified, the API defaults to a standard size (e.g., 50 items per page). - If
pageNumber
is not specified, it defaults to the first page (pageNumber=1
). totalCount
represents the total number of items available across all pages.totalPages
is calculated based ontotalCount
andpageSize
.
# Tips
- Use
pageSize
andpageNumber
together to paginate through large datasets. - Always check the response for pagination metadata (
totalCount
,totalPages
) to help guide navigation. - To fetch all results, loop through pages incrementally until
pageNumber
exceedstotalPages
.