SAP Open Connectors

Pagination

Pagination is used to save us the trouble of having to go through more number of records than necessary. It makes us easier to handle the results of any API calls that have been made. There are three common types of pagination that every API uses:

  1. Page and pageSize
  2. Limit and offset
  3. Cursor

We have standard means of paginating in each connector.

Page and pageSize is our preferred method because it is easy to use and flexible. For this method, the page and pageSize need to be specified. page being the particular page of results you'd like to look at, and pageSize being the number of records that come up in that page.

Limit and offset, also known as Offset pagination is a method that makes use of the limit and offset commands. They work similar to the page and pageSize commands and therefore, can easily be converted to page and page size (pageSize = limit; page = offset/limit).

Cursor pagination is where you call GET /accounts and it returns a nextPageToken. This token is used on the next request to get the next page. It is not so easy to convert cursor based pagination to page and pageSize method of pagination.

Even though we want to use page/page size pagination across the board, it is not always possible. For this reason, you will find support for cursor based pagination everywhere in our platform. Every connector supports cursor based pagination no matter what. That way, you can maintain consistency in your integrations. So, if you have an connector that must be cursor based, you can use cursor based for every connector. 

Every GET /<anyObject> returns the following header:

 elements-next-page-token: eyJwYWdlU2l6ZSI6MiwicGFnZSI6Mn0

And on every one of these APIs, even if its not documented you can send the query parameter nextPage=eyJwYWdlU2l6ZSI6MiwicGFnZSI6Mn0 and it will work the same as if you had sent page and pageSize.

Paginator 3.0 

Paginator 3.0 is the new, more enhanced version of SAP Open Connectors original paginator. Here is a comparison of the two for your better understanding.

PaginatorPaginator 3.0
Requires more time to provide vendor responses.Quicker vendor responses.
Default pageSize set to 200.Default set to 50 or the min/max Vendor pageSize.
Default = min vendor pageSize,if Vendor min pageSIze > 50;
Default = max vendor pageSize,if Vendor max pageSIze < 50
Maximum pageSize set to 2000.
Maximum pageSize set to 1000 or
the maximum vendor pageSize, whichever is lower.
Makes multiple calls to the vendor if the SAP Open Connectors page size is greater than the vendor max page size.
Throws an error if pageSize entered < vendor min pageSize.
Throws an error if pageSize entered > vendor max pageSize.
Supports custom pageSize for Cursor paginationSupports custom pageSize for Cursor pagination.