Some Documents API endpoints that return a list of items support pagination. This means that the response will only contain a limited number of items, and you can request additional pages of items by adding a start parameter to the URL.For example, consider the following request:GET /api?cmd=getLastDigitalOrders_v1
{
"valueObjectList": [
{
"seller": "Marco Bianchi",
...
}
],
"moreRows": true,
"resultSetLength": 20
}
In this case, the response contains 20 values and the moreRows flag is set to true. This indicates that there are more barcodes available that can be retrieved. To request the next page of barcodes, you would make a new request to the same URL with the start parameter set to 20. For example:GET /api?cmd=getLastDigitalOrders_v1&start=20
This would return the following response:{
"valueObjectList": [
{
"seller": "Marco Bianchi",
...
}
],
"moreRows": true,
"resultSetLength": 20
}
You can continue to request additional pages of barcodes by incrementing the start parameter. For example, to request the third page of barcodes, you would use:GET /api?cmd=getLastDigitalOrders_v1&start=40
The following pagination parameters are supported:start: The index of the first item to return. The default value is 0.
limit: The number of items to return per page. The default value is 20.
Example usage#
The following example shows how to retrieve all of the barcodes for a product:GET /api?cmd=getLastDigitalOrders_v1&start=0&limit=20
This will return the first page of barcodes. You can then continue to request additional pages by incrementing the start parameter. For example, to retrieve the second page of barcodes, you would use:GET /api?cmd=getLastDigitalOrders_v1&start=20&limit=20
Warning: Limit not supported for all paginated APIs#
Please note that not all paginated APIs support specifying the limit parameter. Refer to the individual API's documentation to determine if the limit parameter is supported and for information on how to use it.The ability to specify a limit on the number of items to return per page varies depending on the specific API implementation. Some APIs may have predefined limits on the number of items returned per page, while others may not allow you to change this limit at all.Always consult the individual API's documentation for specific pagination information.
If in doubt, test the API with different limit values to determine the actual behavior.
If the API does not support the limit parameter, you may need to retrieve the data in multiple pages and combine them manually.
Modified at 2024-07-26 07:39:44