Forum Discussion

tbuck8384's avatar
tbuck8384
New Member
2 years ago

How do I connect to Web API data with Power BI Desktop?

I am trying to connect Power BI Desktop to a website API and was given the following information on the backend of our web portal to configure API and authentication. See screenshot below. How do I even get started with this?? If I go to Power BI/Power Query and choose "New Source > Web" I tried both the Token URL and Redirect URL, but am unable to authenticate in. The Request URL for the GET Request is something like "https://CompanyName.open.data.com/api/api/intake/v1/requests" and I am also using this URL in the access sign in but am unable to authenticate in with "Anonymous" and if I try and select "Web API" it's asking for a "KEY" which I am not sure I have judging by the information below...Thoughts?

 

How do I connect to this website using API connection info below in Power BI allowing me to get the data and build the dashboards needed?

 

Below is a view of the API connection information that was given to me....

 

 

Also, I am open to any and all suggestions for "Best Practice" solutions here. If this is something better designed in a Dataflow or Datamart let me know. I have a "Premium" Account in the Power BI Platform. Let me know what the best solution would be to design this connection to pull in data. Thanks!

6 Replies

  • Brunner_BI's avatar
    Brunner_BI
    Impactful Individual

    It seems like that you need to get a token first and then get the data with this token.

    Meaning first you need to do a GET request in Power Query to receive the token as a result.

    Then you use this result to send a POST request (is not that straight forward, you need to specify a body of the request only then Power Query will send it as POST - otherwise it always defaults to GET which you dont want) to get the data.

  • BIBB's avatar
    BIBB
    Advocate I

    What other options apart from "ClientCredentials" do you have? If you only have an legged oauth authentication, you will need to build a custom connector, which is more complex. 

    If you have a "basic" option, you should be able to build the query in the Power Query editor and the function that you require Web.Contents. We have written a very complete article, including sample code, about it. 

    https://www.bibb.pro/post/web-contents-and-apis-in-powerbi

    Web.Contents in Power BI





    • lbendlin's avatar
      lbendlin
      Super User

      That article does not cover token authentication.

      • BIBB's avatar
        BIBB
        Advocate I

        I believe your comment is a bit misleading as the article contains several code samples implementing token authentication.