Is there any way to modify the URL parameter of an API request via the Transformer, such that I can increment the pagination for my request?
For example, when I query a certain API, I receive the following JSON response:
{
"data": [
{
"id": "1000",
"type": "employees",
"attributes": {
"id": "1000",
"first_name": "John",
"last_name": "Smith",
"email": "john.smith@company.com",
}
},
{
"id": "1001",
"type": "employees",
"attributes": {
"id": "1001",
"first_name": "Jane",
"last_name": "Doe",
"email": "jane.doe@company.com",
}
}
],
"meta": {
"pagination": {
"per_page": 25,
"page": 1,
"total": 99
}
}
}
I want to use the Transformer to recursively call {{ getEmployees.data }} and increment the URL parameter page[number]
by 1 while data.meta.total - (data.meta.pagination.page * data.meta.per_page) > 0
and concatenate the results.
The query url is currently: "https://partners.humi.ca/v1/employees?page[number]=1"
Although I am trying to assign a variable {{ page }}
to the URL parameter, it doesn't seem to be mutable.