Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Calling Paginated API with an "endCursor" variable that needs to be passed to subsequent calls

Hey there. 

I'm looking for help for a bit of a complicated problem. 

 

I have a connection to a REST API that returns a pagination variable to send on subsequent API requests to retrieve the next page. 

I am trying to loop through the pages and get all the data into PBI desktop but am having trouble doing so with this endCursor variable.

Here's an example response for a call with an "endCursor"(the variable in question) and a "hasNextPage":

 
"pagination": {
        "endCursor": "(random variable is here)",
        "hasNextPage": true
    }
 
I'm not sure how I would be able to pass the variable into the "RelativePath" and have it loop through all the data.
Has anyone done this successfully?

2 Replies