Pagination of list

All list are paginate and limited in maximum of results per range.

Usage

Use the query range to get wanted range ; example, to get the results from 0 to 19 (20 results), the value of range parameter will be range=0-19.

In HTTP responses, you will have 2 headers :

  • Accept-Range: contains the current resource and number of results in current range, example: users 20
  • Content-Range: contains the current range and the total number of resource, example: 0-19/200

If your resources are in multipage, you will have a third header Link, to navigate between ranges.

Example

This is an example to get providers with range from 0 to 19, so 20 providers.

Request

curl --location --request GET 'https://api.iswigo.com/v1/providers?range=0-19' \
    --header 'X-Iswigo-App: {{APP_NAME}}' \
    --header 'X-Iswigo-Signature: {{SIGNATURE}}' \

Response headers

Accept-Range: providers 20
Content-Range: 0-19/340
Link: <https://api.iswigo.com/v1/providers?range=20-39>; rel="next",<https://api.iswigo.com/v1/providers?range=320-339>; rel="last"

The headers explain:

  • 20 providers returned
  • range 0-19 returned
  • 340 results in total
  • Gives next link and last link