Paginate within json body

Describe the problem/error/question

I´m trying to paginate through this api. pageNumber is set in the json body and I´ m. trying to use the pagination from the http request node. But setting Query to pageNumber and referencing it from the response doesn’t work:

“jsonBody”: “{"userId":"c7a43a70-8e8e-41dc-b7da-ad2ed4fe950e","projectId":"90d090ac-b5fd-460f-8ecc-a1b0d8dbf1ad","pageId":"98bc1d6d-b05f-4a80-bad0-4f9fdf68ffb7","isStandalone":false,"locale":"de","isActiveCustomJobPages":true,"isUseLayoutsOfSubsidiaries":false,"filterStatus":{"careerLevel":false,"category":true,"partnership":false,"location":true},"pageNumber":1,"numberOfJobsOnPage":12,"listState":{"search":"","location":{},"filters":{},"filterPredictions":{}},"jobListTitleNew":"Neu","isGetFilters":true,"isForCurrentLocale":false}”,

response contains:

“pagination”: {

“dataSource”: [

1,

2,

3,

4,

5,

6,

7

]

}

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • **n8n version:1.21.1
  • **Database (default: SQLite):SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • **Running n8n via (Docker, npm, n8n cloud, desktop app):npm
  • **Operating system:AWS AMI 2023

Hey @Kool_Baudrillard,
this api has no standard pagination feature, so it is not possible to do pagination within the http node.

You can solve it by doing a loop like this:

In the node Set Request Body it is necessary to change the page dynamically on the runIndex which represents the current loop execution.

After looping you have to aggregate the results of the loop by the code node named Aggregate Results

Cheers.

2 Likes

thx,

that´s what I had in mind, if pagination didn´t work out!.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.