Skip to content

Basic Paginated Response & Request

VeguiDev edited this page Sep 16, 2022 · 2 revisions

Index:

Response

Headers

Headers of paginated response.

x-page-count: Number of available pages.

x-page-index: Index of response page.

x-page-size: Size of the list in response body.

Request

It is the request to an endpoint that returns a paginated list.

Body

page (optional): It is the index of the page. Default:1

sort (optional): Sort the response according to a field. object

fields (optional): List that contains the parameters that will be in the objects of the list.

size (optional): Size of the list returned.

Example

Example requesting resources (/api/v2/resources).

{
    "size": 10,
    "page": 1,
    "fields": ["id","title", "description", "downloads"],
    "sort": {
        "must": "most",
        "field": "downloads"
    }
}

Clone this wiki locally