Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Sam_Jain
Helper I
Helper I

API connection

Hello Commnuity,

 

I'm trying to establish an API connection from the web connector on PowerBI to say xyz.com. Now, this xyz.com has plug and play dashboards, but what i need to do is establish a direct connection so i can call for any/all data present directly. As opposed to exporting to csv from the site and then using that as the source. Now, i have the API key and the vendor was able to show me how they make API calls on Postman and retrieve data inform of JSON. How do i translate this onto PowerBI? 

I know the web connector can read from a web page and extract tables, that is easy. But how do you establish a live/batch API connection ? Any resources or education material will be very helpful and appreciated.

 

Thank you

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @Sam_Jain 

 

There's loads of articles about connectring to an API in PQ - here's a couple

 

https://www.myonlinetraininghub.com/getting-started-with-apis-in-power-query

https://www.myonlinetraininghub.com/connecting-to-an-oauth-api-like-paypal-with-power-query

 

The exact way you set it up depends on what type of API it is, or how it handles authentication.  You said you have an API key but does that need to be supplied as a query parameter, in the request headers etc?

 

Also, do you need to make GET or POST requests?

 

I understand you probably don't know these answers so is there any documentation you can refer me to for this API?  Or you can you provide the Postman queries you were gfiven?  I can probably translate those into Power Query.

 

Remove any sensitive info/security info like the API key first.

 

Regards

 

Phil

 

 

 



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

6 REPLIES 6
AlexanderPrime
Solution Supplier
Solution Supplier

Are you trying to set up via the "From Web" data source?

 

If so, after you put your target url, select advanced. At the bottom should be "HTTP Request Header Parameters", type in the left side "Authorization" and on the right side type in "BEARER {API Key}". Replace {API Key} with your provided API Key, select Okay. And if a prompt when connecting to sign in appears, try using "Anonymous" sign in. 

Does this work for you?


Please note - I am not affiliated with Microsoft, I'm just an end user like yourself.
Just a regular guy doin' Data Science.

If my post has helped you, please don't forget to thumbs up or click "Accept as solution" if it solved your problem!

Hello,

 

Thanks on your repsonse.

Yes, i was trying to set up from web data source. Is there a different method i can attempt?

I tried adding in the bearer and api key as you suggested, however with anonymous sign in i get a unable to connect error stating "Access to the resource is forbidden" and if i were to use the web api sign in it goes back to the same issue where it states "A web API Key can be specified when a web API Key name is provided"

 

Any inputs or guidance here?

 

Thank you

v-henryk-mstf
Community Support
Community Support

Hi @Sam_Jain ,

 

Refer to the advice given by @PhilipTreacy  if it helps you. And if there are still problems, can you explain specifically what kind of requirements you achieve by connecting to web data by api connection.  link

 

Looking forward to your feedback.

 

Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello Henry,

 

Thanks for your response.

 

I'm still facing issues with establishing a connection. I was able to make API calls from the Postman App to test out the API key and metrics. However, am still uncertain on how to make the connection in PowerBI. I keep running into the error message which states "An API key value isn't specified". On Postman i specify the key name as x-api-key and then the value is the actual key and chose the add to header option. I only need the GET method and specify the date range along with source id which is my key metric. Can someone please tell how you establish a connection and get this to work on PowerBI. Thank you

 

Sam_Jain_1-1638972573021.png

 

 

PhilipTreacy
Super User
Super User

Hi @Sam_Jain 

 

There's loads of articles about connectring to an API in PQ - here's a couple

 

https://www.myonlinetraininghub.com/getting-started-with-apis-in-power-query

https://www.myonlinetraininghub.com/connecting-to-an-oauth-api-like-paypal-with-power-query

 

The exact way you set it up depends on what type of API it is, or how it handles authentication.  You said you have an API key but does that need to be supplied as a query parameter, in the request headers etc?

 

Also, do you need to make GET or POST requests?

 

I understand you probably don't know these answers so is there any documentation you can refer me to for this API?  Or you can you provide the Postman queries you were gfiven?  I can probably translate those into Power Query.

 

Remove any sensitive info/security info like the API key first.

 

Regards

 

Phil

 

 

 



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Hello Philip,

 

Thanks for your response. And i apologise for not reponding back sooner.

 

I'm still facing issues with establishing a connection. I was able to make API calls from the Postman App to test out the API key and metrics. However, am still uncertain on how to make the connection in PowerBI. I keep running into the error message which states "An API key value isn't specified". On Postman i specify the key name as x-api-key and then the value is the actual key and chose the add to header option. I only need the GET method and specify the date range along with source id which is my key metric. Can you please guide me on how you establish a connection and get this to work on PowerBI. I feel like am not able to get the first step right, once i establish a connection i could play around on the editor to get the data.

 

Thank you

 

Sam_Jain_2-1638972742406.png

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.