Forum Discussion
A web API key can only be specified when a web API key name is provided.
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!
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.
- nnosaj7 years agoFrequent Visitor
Silly me, actually ericOnline's solution above worked for me as well. It seems there is currently no direct way to use Azure AD as authentication via the UI. I opted to use API key authentication, but did it the wrong way. So i modified my api to have a custom request header passing the API key, and applied the steps above in my Power BI report.
- 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.