Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Web API Key Authentication

Hello,

I am trying to connect to a Web API in Power BI Desktop. The request requires token authentication with an "api_key" parameter.  I continue to get the error that an API key name must be specified in order to provide an API key, but I cannot find where to specify an API key name.

 

I have already tried the following and none have worked:

  1. Anonymus authentication with providing the API key in the URL as a parameter
  2. Basic authentication with the API key as the username
  3. Web API authentication and provided the api key as the key value
  4. Adding a Header in the advanced UI called "Authorization" and providing the key. I also tried to specify the API key name here as "api_key".

I have seen other posts suggesting to create a dataflow to solve this but I do not have the ability to create a dataflow. 

 

What is the proper way to provide token authentication for a Web API?

 

 

Thanks,

8 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi! so "api_key" is actually the same as I need for my URL format.

       

      Additionally, I attempted to do this just as a Blank Query in the advanced editor to bypass the Authentication in the Web API UI. I am still getting errors. Do you have any other tips on how to get this done?

       

      There really should be a much easier way to provide auth for this...

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi-  I have tried that, I have started a blank query and input Web.Contents("my api URL", [ApiKeyName="api_key"]) and saved it, and tried to Get Data from Web using the same api URL and selecting Web API inputting my key in the box. 

     

    I still get the warning that I need to specify an API key name. Could it be that it is not specified in the right editor? Is there any where else to pass this auth?

      • Anonymous's avatar
        Anonymous
        Not applicable

        I tried the auth trick by putting the api_key in the URL as a parameter and selecting Anonymous, that did not work. I received the error that I have invalid credentials but when I test my call in Postman with the same api key, it is fine.

         

        This is the query I have currently: which is still giving me the error that I have invalid credentials.

         

  • Hello Anonymous ,

    I am encountering the same issue. Were you able to find a solution?

    Thanks,
    Victor