My question:
I work with an API that gives results in a page format, meaning that if I want to gather all the data, I have to call the GET function X times (x=number of pages).
Each page has the same value names and the same amount of values per value name (25)
Thus, I have decided to concatenate all the data from each responseBody into one big string that I then JSON.parse() to get the table. This way I will have each of my value names that will hold X*25 values.
However, when I run the code, it works, and I am able to get the concatenation of the whole results, but when I JSON.parse() my concatenation, it only returns me the last call.
Details (like screenshots):
The code :
The format of the data :
The format of the data when changing of type :
When I start a new request, I remove the first { so that I say to the code βit is just more data for you to ingest, it has the same name but different valuesβ. I slice the end so I lose the }, that I add at the every end of the run so my whole string is one big {β¦} that i can .json.parse()
Pagination is an environmental variable, just like body. I use them to keep values in-between two request calls.
I use console.log() to look at what the string looks like, and the end string looks βgreatβ and should be working, but it doesnt.
Do you have any ideas, or is it even possible ? And am I clear enough on my message ? I have started using postman 3 days ago
PS : being limited to 3 pics in my post, feel free to ask for more info if needed