HTTP Pagination Loop

:bullseye: What is your goal?

There’s an API that I need to query and paginate (when there are many items).

The response I get from the API when there are more pages looks like this:

{
    "results": [list of items], 
    "paginationKey": {object that I need to add as is to the next request}
}

So in short what I need to do is:

  1. Send HTTP request.
  2. If no paginationKey in response - stop.
  3. If paginationKey exists - send another request with current “paginationKey”, and continue to aggregate the results.

Any ideas?

:thinking: What is the problem & what have you tried?

I tried using the new HTTP module’s pagination options, but they don’t fit this specific case.

I tried different scenarios with Repeater module, but the problem is that Make doesn’t allow me to “rewrite” the same variable (I tried setting a paginationKey variable and updating it each loop, but I can’t update the original variable).