Hello, I have some question regards the REST api for Confluence and how ‘route’ works.
Previously I was doing something like this in order to repeatedly call REST api until it reaches end of the page:
let address = `/wiki/api/v2/spaces/${spaceId}/properties?limit=250`;
let propertyArray = [];
while(true){
const getProperties = await api.asApp().requestConfluence(route (address), {
headers: {
'Accept': 'application/json'
}
});
const propertyReturn = await getProperties.json();
propertyArray = propertyArray.concat(propertyReturn.results);
if(propertyReturn._links.next == undefined || propertyReturn._links.next == null){
break;
}
//set address to cursor
address = propertyReturn._links.next;
}
So basically, I had a variable that contains the REST API address, and I update it to cursor and call it again until there is no more cursor. However, recently, Atlassian team has update so that you can no longer do:
route (address)
For now, I just have a single REST API call, without having any address variable. I need a way to repeatedly call REST API until there is no more entries. Is there any idea about how to do this with current route changes?