Forum Discussion
Anonymous
3 years agoNot applicable
Structuring a web API to refresh in Power BI Online
Good afternoon all I am currently trying to format my M query so I can upload a report and the connected web link using the advanced section to contain the API Key will refresh. I managed to get ...
artemus
3 years agoMicrosoft Employee
RelativePath is used if you need to add part of the url before the parameters (?). To add dynamic parameter use the Query option.
e.g.
Web.Contents("https://example.com",
[Query = [param1 = "1", param2 = "test"],
ApiKey = "X-API-KEY"
])
Note: As shown in the example above, it is recommended to not include key tokens in your power query, and instead use the ApiKey to indicate the name of the key parameter, and then use ApiKey authentication when you connect.
- Anonymous3 years agoNot applicable
So the issue is I need the API Key within the M Query due to an auto refresh so you're suggesting I do the following:
Web.Contents("https://api.breathehr.com/v1/departments/104295/absences?per_page=100&page=",
[Query = [Param1 = Number.ToText(Page)]] , [Headers=[#"X-API-KEY"="prod-APIKeyHere"]])),