Forum Discussion
API Pagination + Throttling + Dynamic data source issue
- 5 years ago
Take a look at this blog for how to use the query option available in web.contents
I'm not sure what you tried based on my blog post, but hopefully I can point you in the right direction. The Web.Contents function wants a static URL in order to work properly in the Power BI service. You use the Query argument to override the static portion of the URL with the variable(s) that you want to use. Basically, the way that I think about it is to put everything that follows the ? in your static URL into the Query argument.
I can't test it myself, but you're looking for something like this (check the parentheses, brackets, commas, etc.):
Source = Json.Document(Web.Contents(“https://inventory.dearsystems.com/externalapi/v2/salelist?Page=1&limit=1000”,
[Headers=[#"api-auth-accountid"="xxxxxxxxxxxxxxxxxxxxxxxxxxx", #"api-auth-applicationkey"="xxxxxxxxxxxxxxxxxxxxxxxxxxx”]],
[Query = [Page=Number.ToText(page), limit=1000]]))
- Landcrab5 years ago
Helper I
Thank you Stacia, I had the square bracket in the wrong place. turns our it shoud be
Source = Json.Document(Web.Contents(“https://inventory.dearsystems.com",[RelativePath="/externalapi/v2/salelist,Query=[Page=Number.ToText(page),Limit=1000],
Headers=[#"api-auth-accountid"="xxxxxxxxxxxxxxxxxxxxxxxxxxx", #"api-auth-applicationkey"="xxxxxxxxxxxxxxxxxxxxxxxxxxx”]]))