I got an API where I am doing a POST request. It accepts a page and pageLimit. I am then receiving a list of 100 contacts per page in an array. In the body I have a field called “total” that contains the total amount of contacts that matched that request. But pagination in this situation is an issue because I dont have the standard things you would expect in a paginated api like this. This is my module setup:
"response": {
"output": {
"{{...}}": "{{body}}",
"headers": "{{headers}}",
"statusCode": "{{statusCode}}"
}
},
"pagination": {
"body": {
"{{...}}": "{{omit(parameters, 'page')}}",
"page": "{{floor(body.total / 100)}}"
},
"condition": "{{floor(body.total / 100)}} >= {{pagination.page}}"
}
The response object works nicely as expected to show all the 100 contacts. But the total will show something like “313”. So I tried to use floor to give a whole number to identify the page I am on. I also realized working with a POST I can use the QS, so I swapped to body as thats what the docs mentioned was possible. So I pull in the original body, omit the page param (which is set to 1 as default), and then set the page for the next request with the floor formula. But the issue is it’s not paginating through everything. Anybody seen anything like this?