Forum Discussion
A web API key can only be specified when a web API key name is provided.
I have the same issue connecting to Microsoft Cognitive Services Sentiment Analysis API.
Works no problem with the API key name and key hardcoded into the Web.Contents header section, but if I try to replace with the ApiKeyName option I get the same error. This option supposedly just inserts the specified header using the Credentials dialog inputs so I don't see why the result is different.
Surely this is a bug?
I know its a LONG time later, but here is how I solved this error:
API Method:
- GET
Steps:
- Click Get Data
- Click Web
- Click Advanced
- Enter entire query string with parameters
- Enter API Key and Value as a header
- Click Connect
- HERES THE SECRET: Select "Anonymous"
- It was intuitive for me to want to click "API Key". But this is what resulted in the error.
I was then able to retrieve the API results and expand columns. AWESOME!
Hope this helps!
- nnosaj7 years agoFrequent Visitor
This might look like a silly question for you, but how did you actually enter the API key and Value as a header?
I have this API from an Azure app service secured by Azure Active Directory, and I generated a key (client secret) from there. I am struggling to put that key into the request header when creating a Power BI report (Get Data from Web). I cannot find the API key name. I mean I got the actual API key but i do not have the API key name or can't seem to find it.
- ericOnline7 years agoPost Patron
Hi nnosaj. I'm fairly new at API calls and its been awhile since I worked on this project. I ended up writing a POST request in the Advanced Editor. Check this forum discussion between ImkeF and myself. Might have some insights.
Good luck!
- nnosaj7 years agoFrequent Visitor
Thank you, ericOnline! Yes, I might have to try the Advanced Editor. I find the UI is not as simple to use as it looks, when it comes to particular cases like this.
- ImkeF7 years agoCommunity ChampionWhat kind of authentication does your app allow?
- nnosaj7 years agoFrequent Visitor
Hi ImkeF,
The .NET api itself, I created it without authentication, so at most, it is just anonymous authentication.
The actual authentication (Authentication/Authorization), I set it up in Azure when I published and registered my api there. The provider I set is Azure Active Directory. The registration allows you to generate a key for API access. This key I put as client secret for my api.
- ericOnline7 years agoPost Patron
For what its worth, I just found a good explanation of what this error message is referring to. It appears that when you specify "ApiKeyName = "youapikeygoeshere" " in a PowerQuery, this message will show up.
See this video at the 17:54 mark.
Cheers!
- Anonymous6 years agoNot applicable
Works perfectly. Thanks!