Forum Discussion
Rest API - 90 Day restriction
Hi vwiles84
You can create a table in Power Query with multiple URL strings as rows containing 90 windows and then call all and app and into one dataset
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
- parry2k6 years agoSuper User
vwiles84 this M code will create start and end date range and will update daily, just add another column and make api call from the WebURL column and you are good to go.
let MaxDays = 90, EndDate = Date.From(DateTime.LocalNow()), StartDate = Date.AddDays(Date.From(EndDate),1-MaxDays), Source = #table({"StartDate","EndDate"} ,{{StartDate,EndDate}}), #"Changed Type1" = Table.TransformColumnTypes(Source,{{"StartDate", type datetime}, {"EndDate", type datetime}}), #"Added Custom" = Table.AddColumn(#"Changed Type1", "WebURL", each "https://website/order_items?time_start=" & DateTime.ToText([StartDate],"yyyy-MM-dd")&"&time_end="&DateTime.ToText([EndDate], "yyyy-MM-dd"), type text), #"Added Custom1" = Table.AddColumn(#"Added Custom", "WebData", each Web.Contents([WebURL])) in #"Added Custom1" - vwiles846 years agoHelper III
What is the best way to call multiple URL strings? I tried editing my Json.documeent(Web.contents(www.apiurl parameter/) with an AND command but it doesn't work. Is there another place to join the api calls?
- parry2k6 years agoSuper User
vwiles84 did you tried my solution, parameters in that is already part of URL
Ask anything Power BI. Book appointment for a free consultancy at https://www.perytus.com
- vwiles846 years agoHelper III
I have not yet. I will now but, i think if I can just make 4 calls with the 90 day date range (01/01/20-03/31/20 then 4/1/20-6/30/20, then 7/1/20-9/30/20, etc), it will work the same. I don't know that i need to specify the max number of 90 if I can make 4 API calls with the date range changed. If that make sense.