Forum Discussion
Conditional call many api trought next page key and making a list
Hi,
it's my first time on the community 🙂 though it's not my first time working with Power Query. Hi to every Power Query (and Excel) lover. As of today I've learned pretty much everything I did by reading here. I'm going trought a use case that I would consider pretty hard and for this reason I reach for your help here.
1. My data source comes from an API Call:
https://dynatrace.domain.it/e/tenantid/api/v2/problems?Api-Token=xxxxxxxxxxxxxxxxxxxx&pageSize=500&from=-1d
2. When the api get downloaded I got the following dataset > with this first Api call I have a subset of data; the value in "nextPageKey" is the value that I need to imput in order to extract the subsequent subset of data :
3. In order to make the subsequent call the api will take this shape:
https://dynatrace.domain.it/e/tenantid/api/v2/problems?Api-Token=xxxxxxxxxxxxxxxxxxxx&nextPageKey=AQANMTY....
My final goal is to loop those api call so I can have a full list of "nextPageKey" values. After I have the full list of the possibile nextPageKey, I'll call it in order to have a full table of the "problems" field.
I have read about List.Generate and I have seen many example of incremental loop (by setting a function) but in my case the nextPageKey is an alphanumeric that is only generate after each subsequent api call.
Thank you for your time a patience
2 Replies
- lbendlinSuper User
List.Generate is still the right thing to do here (assuming that your browser cache can absorb the cost of calling each page twice). What have you tried and where are you stuck?
It is close to impossible to assist with API questions without access to the API.
- dmartins3103New Member
Hi,
I have the same problem, did you manage to find the solution?