Forum Discussion
A web API key can only be specified when a web API key name is provided
- Anonymous5 years ago
Hi deanbland ,
Please review the content in the following links, hope they can help you resolve the problem.
1. Get data from web error: A web API key can only be specified when a web API key name is provided
Solution:
- Open Power BI Desktop and on the Home tab, select Get data and choose the Web option.
- Paste your metric query's URL into the Power BI dialog asking for the Web page URL.
- In the Access web content dialog, select Basic, enter your app's API key as the Username, and press Connect
Solution: Add ApiKeyName = "ApiKey" as part of the 3 parameter of using OData.Feed
let Source = OData.Feed("https://localhost/odata", null, [Implementation="2.0", ApiKeyName = "ApiKey"]), Table_table = Source{[Name="Table",Signature="table"]}[Data] in Table_table3. A web API key can only be specified when a web API key name is provided
Best Regards
i had to connect to my data using the web connector without authenticating, knowing that it would fail, so Power BI would build the shell of the query. then i went into the advanced editor to updated Web.BrowserContents() to Web.Contents() which allowed me to pass the key name and value through the headers with:
let
Source = Web.Contents("https://{uri removed intentionally}", [Headers = [#"Authorization" = "Bearer {key removed intentionally}"]]),
then Power BI pulled in my data