How do I paginate from a REST API with Next in Headers?

Hi!
This API source offers “next” in the response header, and inside “<>”, but I don’t know how to extract it from inside the “<>” and the pagination loop in Make.

I tried to use the repeater, but it always gives an error, as the initial parameter must be a number and not a link.

I believe the flow would be:

  1. Request the first page
  2. Treat the header
  3. Loop
  4. Accumulate results
  5. Upload to Google Sheets

Hi,

  1. why not use the shopify module directly?

  2. so you are trying to get the pagination done?

2 Likes

You can use the built-in functions map and first:

e.g.:

{{ first(map(2.headers; "value"; "name"; "link")) }}

Then, you’ll need to use a Text Parser to extract links from a string variable

For more information, see https://www.make.com/en/help/tools/text-parser


Links

Here are some useful links and guides to help you get started and learn more on how to use the Make platform, apps, and app modules —

General

Help Center Basics

Articles & Videos

2 Likes

I always get authentication error and it doesn’t work.

If you read the instructions below the Domain field, you only need to insert your subdomain, and not the full URL.

4 Likes

This worked, but connecting was never a problem, now I’m in the looping step. What do you recommend me to follow?