Introduction
The Penzle Rest API supports a large majority of API request functionalities for retrieving resources through a collection. You could, for instance, list assets, list entries, and so on and so forth. These list API methods all have the same basic structure, in which they take at least two parameters like page
and pageSize
, in order to perform pagination and improve user experience in the first place.
Suppose you do not specify either page or pageSize query parameters. In such a case, you will have access to the first page of this stream, which contains the objects in the items array and the stream metadata, as seen in the example.
You have the option to specify both the page and the pageSize, which allows you to describe the page you are targeting and the number of items you want returned on each page.
The default value for the page
is 1 and for pageSize
is 10.
Parameters
pageSize |
integer($int32) Nullable
The page size of the response. The default value is 10.
|
page |
integer($int32) Nullable
The page number of the response. Started from index 1.
|
Responses
PageIndex |
integer
A page number for the current stream returned from the backend. Default: 1
|
PageSize |
integer
Maximum size any individual stream. Default: 10
|
TotalCount |
integer
Number of individual objects that make up the entirety of the superset. Default: N/A
|
TotalPages |
integer
Number indicating the overall number of subsets available within the superset. Default: N/A
|
HasPreviousPage |
boolean
Returns true if the superset is not empty, PageNumber is less than PageCount, and this is not the first subset. Default: false
|
HasNextPage |
boolean
Returns true if the superset is not empty, PageNumber is less than PageCount, and this is not the last subset. Default: false
|
Items |
Array []
The type of objects that should be included in the collection. Default: N/A
|
⚠️ An increased page size reduces the number of calls to the API endpoint but doubles the quantity of data provided for each API call. Please keep this in mind when defining pageSize, since it could affect performance and the end-user experience.
Response body
{
"pageIndex": 1,
"pageSize": 10,
"totalCount": 100,
"totalPages": 10,
"hasPreviousPage": true,
"hasNextPage": true
"items": [
{
...
},
{
...
}
]
}