Forum Discussion
Holguinmora
6 years agoHelper I
Connecting to an API
Hi I´m trying to connect to the next API using Blank Query but it’s been more complex that I thought. Is it possible for anyone to give me a hand or contact me to so I can Pay an be able to get t...
- 6 years ago
Hello Holguinmora
as you passed me your credentials, I was able to develop something for your. I've tested it and it should work. Here the code
let Final = List.Generate ( ()=> [ Result= Json.Document(Web.Contents("https://api.repsly.com/v3/export/clients/0", [Headers=[Accept="application/json"]])), TotalCount = 1 ], each [TotalCount]>0, each [ Result= Json.Document(Web.Contents("https://api.repsly.com/v3/export/clients/" & Text.From([Result][MetaCollectionResult][LastTimeStamp]), [Headers=[Accept="application/json"]])) , TotalCount = [Result][MetaCollectionResult][TotalCount] ], each [Result][Clients] ), FinalTable = Table.FromRecords(List.Combine(Final)) in FinalTableCopy paste this code to the advanced editor to see how the solution works
Give it a test and let us know
If this post helps or solves your problem, please mark it as solution.
Kudos are nice to - thanks
Have fun
Jimmy
Jimmy801
6 years agoCommunity Champion
Hello Holguinmora
we can have a try.
For sure List.Generate is needed to loop through all timestamps till TotalCount = 0.
I'm not able to test it, because I don't have access.
You could contact me with a private message
All the best
Jimmy