Offset start for pagination by offset

Hi, I’m trying to call and API endpoint that has a limit of 1000 results per page. The API URL looks like this:
https://{apidomainurl}?Limit=1000

I would like to paginate the results by offset, but I get the following error when I try to do so:
[RVR-RCT-400]: Actions - Bad request. Error message: Rest request got Error response code : 406. Response is: {“errorCode”:406,“errorText”:“Suppied Offset must be greater than 1”}.

The river works when I set the Offset start to 1, however this results in the 1st row of the dataset being excluded in the results.

Any guidance on how I can solve this would be greatly appreciated

Hey,

Pagination is a crucial concept in web development, especially when dealing with large datasets. It allows users to navigate through data efficiently without overwhelming the server or the user interface. One common method of implementing pagination is using an “offset”.

I am also working on it so I use this for reference: https://developer.box.com/guides/api-calls/pagination/offset-based/

You can also visit this. May be this will help you in resolving your issues.

hi @ruwi this indeed is a tricky one, since the way the pagination works in Rivery for this mode is to start with a particular offset integer and iterate based on the limit value. It doesn’t seem you can switch from ‘no offset’ to an integer offset in the next iteration.

the only thing i can think of (and it is definitely a workaround) is to have two rivers:

  • One that starts with offset =1 in the way you got it working
  • One with ‘blank’ offset that pulls only the first record (so limit = 1) with no pagination set up

Both of the above would output into the same destination table, with ‘upsert-merge’ as the loading method. It’s clunky for sure. But the only other option would be hardcoding in a python step in a logic river.