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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

connect to a web api from power BI

Hi Community

I am trying to connect to a web api via PBI desktop.

I have been provided with the details of the api, but I am unable to figure out how to translate that into PBI to get my results

below are the details that I need to fetch

 

GET /0/facebook/profiles

HTTPS Host: api.mywebsite.com

Authorization: Basic wxxXZcCRpbjp5c4V1UqVHgdtwHTF

Content-Type: application/json; charset=utf-8

 

So far, I am using web connector, in URL I am putting https:\\api.mywebsite.com

then,

in add header I am giving autorization code, and add header content type =application/json

 

But I am not sure where to provide the first line ie GET /0/facebook/profiles

 

 

any help would be highly appriciated. any directions or links to material or any quick hints.

regards

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

If I am reading that correctly, you need to connect to:

 

https://api.mywebsite.com/0/facebook/profiles

 

In other words, you should be getting /0/facebook/profiles from the host api.mywebsites.com.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

If I am reading that correctly, you need to connect to:

 

https://api.mywebsite.com/0/facebook/profiles

 

In other words, you should be getting /0/facebook/profiles from the host api.mywebsites.com.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Awesome, Thanks. 

If I also need to fetch something specific, say I am using following request

Let

Source = Json.Document(Web.Contents("https://api.mywebsite.com/facebook/profiles",
[Headers=[Authorization="Basic TWpjNekV5WHpNNVpEQTBZMlZpWkRJNE9EY3habVU1WdRellqRTE6NDRmMjk1NTM3ZTVhZmENTlmNDg0Nkjdsoifuwenr",
#"Content-Type"="application/json; charset=utf-8"]],

In 

Source

 

 OutPUT:

id, name, count, city

 

if I want to fetch data ony for a specific id, say id number 100 & city = Sydney, how would I ammend the query

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.