Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
deanbland
Helper III
Helper III

A web API key can only be specified when a web API key name is provided

Hi, 

 

I am trying to connect Power BI to a web api using this URL (https://api.10000ft.com/api/v1/), but when I enter the API key, I get this message: 

 

A web API key can only be specified when a web API key name is provided. 

 

Unsure what I need to do so any help would be appreciated! 

 

Thanks, 

 

Dean

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

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: 

  1. Open Power BI Desktop and on the Home tab, select Get data and choose the Web option.
  2. Paste your metric query's URL into the Power BI dialog asking for the Web page URL.
  3. In the Access web content dialog, select Basic, enter your app's API key as the Username, and press Connect

2. How to specify an API key name in Excel - A web API key can only be specified when a web API key nam...

  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_table​

 

3. A web API key can only be specified when a web API key name is provided

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
mmeyers
Frequent Visitor

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

v-yiruan-msft
Community Support
Community Support

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: 

  1. Open Power BI Desktop and on the Home tab, select Get data and choose the Web option.
  2. Paste your metric query's URL into the Power BI dialog asking for the Web page URL.
  3. In the Access web content dialog, select Basic, enter your app's API key as the Username, and press Connect

2. How to specify an API key name in Excel - A web API key can only be specified when a web API key nam...

  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_table​

 

3. A web API key can only be specified when a web API key name is provided

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
lbendlin
Super User
Super User

Here's the relevant documentation:

Web.Contents - PowerQuery M | Microsoft Docs

Helpful resources

Announcements
September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Top Solution Authors