Forum Discussion
Dynamically calling of API
- 4 years ago
Hi Anonymous
See this PBIX file for a working example.
You can create a function and call the API from inside that, passing in the ID and TokenID for each row.
The code within the function looks something like this
Source = Web.BrowserContents("https://website.com/id="&id&"&tokenid="&tokenid)And for each row you have code that calls the function like this
= Table.AddColumn(#"Changed Type", "API Call", each APICall(Text.From([Id]), [TokenID]))You will of course need to enter the correct website address in the function to reach your API.
You also make no mention of needing authentication to the API so no code for this is included.
Regards
Phil
Hi Anonymous
See this PBIX file for a working example.
You can create a function and call the API from inside that, passing in the ID and TokenID for each row.
The code within the function looks something like this
Source = Web.BrowserContents("https://website.com/id="&id&"&tokenid="&tokenid)
And for each row you have code that calls the function like this
= Table.AddColumn(#"Changed Type", "API Call", each APICall(Text.From([Id]), [TokenID]))
You will of course need to enter the correct website address in the function to reach your API.
You also make no mention of needing authentication to the API so no code for this is included.
Regards
Phil
Hi Philip,
I am getting the following error while calling API
An error occurred in the ‘’ query. DataSource.Error: Web.BrowserContents currently supports only anonymous credentials
Regards,
Keerthi