Skip to main content

Pagination

Pagination returns the pages of response. 

There are 6 types of Pagination in API Data Source of eZintegrations as Out of the box pagination settings. These are industry standard API architecture based pagination

  • Next URL Pagination
  • Offset Pagination
  • Total Page Count
  • Pagination with Body
  • Cusrsor Pagination
  • Encoded Next Token


Next URL Pagination

This pagination will apply when we have URL of next page in our API response. For example we have next link in this key @odata.nextLink


image.png

Select Next URL pagination from the dropdown and fill these values there.

image.png

  • In the above example @odata.nextLink key helps to identify upto which page the pagination will be completed , so it will come in User Key
  • Data Collection Key holds the data from the API and we will get the response in that key for example here it is ['value']
  • Another Response Parameter key will hold the response of the next url page, This value needs to same as that of Data Collection Key.

Offest Pagination

This pagination we will apply when we have "hasMore":true in our API response.

image.png

Select offset pagination from the dropdown and fill these values there.


image.png

  • In the above example hasMore key helps to identify upto which page the pagination will be completed , so it will come in User Key
  • As we are using Offset pagination so Key Name to Update will be offset
  • Data Collection Key holds the data from the API and we will get the response in that key for example here it is ['items'].

Total Page Count

This pagination will apply when we have total_pages key in our API response. For example we have total page Count in this key total_pages

Example 1: When we have the user key in root keys


image.png

Select Total Page Count from the dropdown and fill these values there.


image.png

  • In the above example total_pages key helps to identify upto which page the pagination will be completed , so it will come in User Key
  • As we will be updating page value for going to next page data so Key Name to Update will be page
  • Data Collection Key holds the data from the API and we will get the response in that key for example here it is ['data'].

Example 2: When we have the user key in nested form.


image.png

Select Total Page Count from the dropdown and fill these values there.


image.png

  • In the above example total_pages key helps to identify upto which page the pagination will be completed , so it will come in User Key, as we can see in the example data total_page key is deep nested so we will pass the User Key as above.
  • As we will be updating page value for going to next page data so Key Name to Update will be page
  • Data Collection Key holds the data from the API and we will get the response in that key for example here it is ['data'].

Pagination with Body

This pagination will apply when we have nextPageToken key in our API response. For example we have next page token in this key `nextPageToken

image.png

Select Pagination with Body from the dropdown and fill these values there.


image.png

  • In the above example nextPageToken key helps to identify upto which page the pagination will be completed , so it will come in User Key
  • As we are getting a token from this pagination so Key Name to Update will be pageToken
  • Data Collection Key holds the data from the API and we will get the response in that key for example here it is ['reports'][0]['data']['rows'].

Cursor Pagination

This type of pagination ususally sends a cursor in response header when a API is requested. This is typically used in User Interface based APIs

image.png

Encoded Next Token

This type of pagination is similar to Next URL Pagination but here the next token is encoded

image.png