Forum Discussion
dynamic web api source schedule refresh on powerbi service
- Anonymous4 years ago
Hi Anonymous - it difficult to validate the following but I think it relates to the following line in the above:
data_url = "https://api.websitename.com/im1/run/details?start_date=" & Start_Date_Parameter & "T12:00:20Z&end_date=" & End_Date_Parameter & "T12:00:20Z",
The concatenation of the URL string including the "?start_date" may not work as Chris describes in his blog. This component needs to be moved in the "Relative Path". i.e. not included in the main URL. This will allow Power BI to check the credentials based on the main url instead of the dynamic url that includes dates.
- Anonymous4 years ago
Hi Anonymous
Thanks! finally got it working after continuous try
data_url = "https://api.websitename.io/im1/run/details",
data_body = "{
""authorization"": """& AccessTokenHeader & """,
""content-type"": ""application/json"",
""CATEGORY-ID"":""" & Category_Parameter & """
}",GetGroups = Json.Document(
Web.Contents(
data_url, [Query=[start_date=Start_Date_Parameter & "T12:00:20Z", end_date=End_Date_Parameter & "T12:00:20Z"],
Headers = Json.Document(data_body)
]
)
)
Hi Anonymous - it difficult to validate the following but I think it relates to the following line in the above:
data_url = "https://api.websitename.com/im1/run/details?start_date=" & Start_Date_Parameter & "T12:00:20Z&end_date=" & End_Date_Parameter & "T12:00:20Z",
The concatenation of the URL string including the "?start_date" may not work as Chris describes in his blog. This component needs to be moved in the "Relative Path". i.e. not included in the main URL. This will allow Power BI to check the credentials based on the main url instead of the dynamic url that includes dates.
- Anonymous4 years agoNot applicable
Hi Anonymous
Thanks! finally got it working after continuous try
data_url = "https://api.websitename.io/im1/run/details",
data_body = "{
""authorization"": """& AccessTokenHeader & """,
""content-type"": ""application/json"",
""CATEGORY-ID"":""" & Category_Parameter & """
}",GetGroups = Json.Document(
Web.Contents(
data_url, [Query=[start_date=Start_Date_Parameter & "T12:00:20Z", end_date=End_Date_Parameter & "T12:00:20Z"],
Headers = Json.Document(data_body)
]
)
)- Anonymous4 years agoNot applicable
Well done Anonymous - it does make sense that the "im1/run/details" is still included in the main URL. Only the parts after the ?.
- Anonymous4 years agoNot applicable
Hi Anonymous , thank you for the quick response.
I tried the following and few other "RelativePath" wraping on "Web.Contents(" and no luck, (Expression.Error: 3 arguments were passed to a function which expects between 1 and 2. Details: Pattern= Arguments=[List])
data_url = "https://api.websitename.io",
data_body = "{
""authorization"": """& AccessTokenHeader & """,
""content-type"": ""application/json"",
""CATEGORY-ID"":""" & Category_Parameter & """
}",GetGroups = Json.Document(
Web.Contents(
data_url, [
RelativePath="im1/run/details",
Query=[start_date = "Start_Date_Parameter" & "T12:00:20Z"
,end_date = "End_Date_Parameter" & "T12:00:20Z"]
],
[
Headers = Json.Document(data_body)
]
)
),