This endpoint provides pagination support for the /api/v1/users
resource. It allows clients to fetch a subset of users based on specific page numbers and page sizes.
Usage
To retrieve a list of users with pagination, you can make a GET request to the following URL:
GET /api/v1/users/pagination?page=<page_number>&size=<page_size>
page_number
: The page number you want to retrieve (1-indexed).size
: The number of users per page.
Parameters
page_number
: Integer representing the page number.size
: Integer representing the number of users per page.
Example
To get the second page of users with 10 users per page, you would make a request like this:
GET /api/v1/users/pagination?page=2&size=10
Response
The response will be a JSON object containing the list of users and pagination metadata:
{
"users": [
{
"id": 1,
"username": "user1",
"email": "user1@example.com"
},
// ... more users
],
"pagination": {
"current_page": 2,
"per_page": 10,
"total_pages": 5,
"total_users": 50
}
}
For more information about user resources, please refer to the User Resource Documentation.
User List