Paginated API Request (Parameters in Body) Bug? $pageCount not incrementing

Describe the problem/error/question

I’m making a request in n8n and having trouble updating the “pagina” parameter in the JSON body for pagination.

What is the error message (if any)?

No error message, but the pagination does not work as expected. It repeats the data from the first page because the “pagina” parameter doesn’t change.

Please share your workflow

These APIs are for testing purposes and return sample data…

Additional context

Here is the cURL request that might help understand the issue:

curl -s https://app.omie.com.br/api/v1/geral/clientes/ -H 'Content-type: application/json' -d '{"call":"ListarClientes","app_key":"38333295000","app_secret":"fed2163e2e8dccb53ff914ce9e2f1258","param":[{"pagina":1,"registros_por_pagina":50,"apenas_importado_api":"N"}]}'

I tested it in Postman, and it works fine.

For the first page, this is the JSON I send to query:

{
  "call": "ListarClientes",
  "app_key": "38333295000",
  "app_secret": "fed2163e2e8dccb53ff914ce9e2f1258",
  "param": [
    {
      "pagina": 1,
      "registros_por_pagina": 50,
      "apenas_importado_api": "N"
    }
  ]
}

For pagination, I’ve tried different approaches, but the request keeps returning the same data (from page 1). One of the formats I tried is below, but it doesn’t update the “pagina” parameter:

:melting_face: I’ve already used ChatGPT, searched for videos, tried n8n’s built-in AI, and now I’m reaching out to the Community for help with this challenge.

Information on your n8n setup

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

I’m not entirely sure, but it seems similar to an issue I had with Magento. I’ve now built the pagination manually outside the HTTP node. Maybe my post could be helpful to you.

I found the solution in another forum.
Sending the JSON with Fields, updating the entire “param”.
Here’s how it turned out:

2 Likes

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