Power BI – Connect to your secure API

Power BI’s web portal and desktop application are slightly different, but this tutorial will work for both.

Getting API Data

  1. Open up Power BI and select “Edit Queries”.
  2. Click “New Source” and select “Blank Query”.
  3. Next, select “Advanced Editor”.

    Capture.PNG

  4. In the editor, enter the API’s address and any header information needed for that api.
    let
         apiUrl = "https://xxxxxxx/api/info",
         options = [Headers =[#"Subscription-Key"="xxxxxxxxxxxxxxxxxxxxx"]],
         result = Web.Contents(apiUrl , options)
    in
         result
    

    Capture.PNG

  5. After you add the Query, you will then need to “Connect”. In Power BI Desktop, a warning message pops up letting you know this. Click “Edit Credentials”

    Capture.PNG

  6.  The Access Web content pop-up will show a few different ways to set up you API credentials.  For this example, we just needed to include a “Key” in the header. Since we already did that, all we have to do is press “Connect”.

 

Thats it! You should now be connected and see the results of the api call.  You can “drill” into the results and select what information and object are important to you.  As you do this, check out “Advanced Editor” again.  You will see that slight changes are made to it as you configure the data you want.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s