I’m trying to setup a workflow using the REST API to retrieve lists of endpoints from various sites within an endpoint management system we use. So far its authenticating, retrieving the bearer token, using that to retrieve the list of sites and then looping through the sites to retrieve the endpoint lists and it’s working well.
The problem is the API will only retrieve the first 50 endpoints in a site and most sites have more than 50 endpoints - the API responses do include a nextPagekey value which I’ve used in Powershell scripts with the same API to loop and build up a single endpoint array, but how can i use this key to loop through all pages until I’ve processed all pages within an insightConnect workflow?
Ideally i’d like the result to be a single array of all endpoints that i can then cycle through in the next loop, but another option could be to loop through the first 50, then retrieve the next page of 50 and so on, but I can’t work out how to do either at the moment so any help would be helpful.
Thanks in advance