Pagination
When you call an endpoint to retrieve a list of items via the GET
method, that endpoint would also support pagination.
Pagination is a technique used to manage and retrieve large datasets efficiently. Instead of returning the entire dataset in a single response, which can be resource-intensive for both the server and the client, pagination divides the data into smaller, manageable subsets called "pages."
We utilise the page
and limit
fields as query parameters to paginate lists. For more context, here's an example to explain how this would work.
In this example, we're making an API request to a transactions endpoint and fetching a limit
list of 2 books from the first page
curl https://wewireapi.com/transactions?limit=2&page=1
We should have a response structured as follows, which is guaranteed across all endpoints.
{
"data": [
{
"id": "93092390482903489084902",
"amount": 200,
"currency": "AED",
"description": "Test transaction 1"
},
{
"id": "93443869823741234242423",
"amount": 100,
"currency": "USD",
"description": "Test transaction 2"
}
],
"page": 1,
"totalItems": 200,
"limit": 2
}
Last updated