Forum Discussion
How to connect a Rest API with variable path parameters as endpoints in URL with Power BI?
- Anonymous4 years ago
HI ANNOAH,
You can create a query aptamer with text type and invoke it in your query table steps, then you can change the query parameter by rest API to dynamic affect the data source target:
let Path = "/name/server/api/" & Parameter, Result = Web.Contents( "https://test.com", [ Headers = [ Authorization = "Bearer " + token, RelativePath = Path ] ] ) in ResultDatasets - Update Parameters In Group - REST API (Power BI Power BI REST APIs) | Microsoft Docs
Regards,
Xiaoxin Sheng
Hi Ibendlin,
thank you for your answer!
If I do so, I get a list of hundreds of numbers. But now I would like to get the information for a specific number. How can I invoke the information of this specific number? This is what my extended API call with the variable path parameter would do. The reason I am using such an API is that I do not want to load all the data to Power BI, I just want to invoke the data that I need by the API and use it in Power BI to minimize data load.
Kind regards,
ANNOAH
HI ANNOAH,
Did the API support query string? If that is the case, you can consider adding a query option in the web connector:
let
Path = "/name/server/api/" & Parameter,
Result =
Web.Contents(
"https://test.com",
[
Headers = [
Authorization = "Bearer " + token,
RelativePath = Path
],
Query = [
id = Parameter2
]
]
)
in
Result
Regards,
Xiaoxin Sheng