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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
litus
Frequent Visitor

Can't connect to Web API . Error "A web api key can only be specified when api key name is provided

Hi,

 

Could somebody help?

I'm tryin to connect to 2 different Web API that brings a Json and you authenticate with a private key.

 

one service is ClickUp™ | API Docs and the other is List Documents (holded.com)

 

Both cases in postman web it works very well but When I use the Power BI desktop assistant I setup advanced I allways got the same error what I can't understand:

 

litus_1-1657810965750.png

 

litus_2-1657810998612.png

 

 

Please any help would be appreciated I have not found any similar problem in the forum.

 

thanks!

 

 

10 REPLIES 10
stefan_iceland
Frequent Visitor

Did you ever get this to work?

Hi, Yes is working for me. In my case with Holded ERP.

 

thanks!

v-rongtiep-msft
Community Support
Community Support

Hi @litus ,

Please refer to these related threads.

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

OData error message a web api key can only be specified when a web api key name is provided 

As mentioned by yingyinr , you can try to select Basic, enter your app's API key as the Username, and press Connect

 

The API key DEMO_KEY can be passed in three different ways, depending on whether you prefer to use the URL, a header, or basic authentication.

  1. Custom header: provide the API key in the custom header X-Api-Key
  2. Query parameter: provide the API key in the URL parameter api_key
  3. Basic authentication: provide the API key as either username or password. If you provide both, the API key must be in the username.

 

Best Regards
Community Support Team _ Polly

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

Hi,

Thanks for your help, the same with "select Basic, enter your app's API key as the Username" it says "Can't connect with this credentials.

 

lbendlin
Super User
Super User

Read the section about ApiKeyName

 

Web.Contents - PowerQuery M | Microsoft Docs

Thanks for your info Ibendlin. 

 

Where I can put my real key value?

 

Web.Contents("https://contoso.com/api/customers/get", [ApiKeyName="api_key"])

Hi,

 

Thanks so much for your help.

 

What do you think I'm doing wrong? I'm testing all the posible things

 

litus_0-1658088757400.png

 

Missing the square brackets.

 

[Headers = ...]

Hi, 

thanks for your help. No luck Now I'm trying in another way but no luck "what a nightmare" .

 

(The key is not complete in the screenshot for obious safe reasons)

 

 

litus_0-1658159156285.png

 

Thanks for your help Ibendlin

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.