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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Connect Power BI with API provided by supplier (non-Anonymous)

Hi Everyone,

I need to connect to a supplier's portal to receive data from there.

The API has been tested outside Power BI and the POST - GET request looks like this:

----------------------------------------------

curl --request POST \
  --url1 https://XXX \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data grant_type=client_credentials \
  --data client_id=XXX \

  --data client_secret=XXX

And using the received token:

curl --request GET \
  --url2 'https://api.XXX' \
  --header 'Authorization: Bearer (token)'

--------------------------------------------------

I having a hard time to mimic the same in Power Query.

After a while I was succesfully created the POST request and received the Bearer access_token, but struggling to create a GET request, where I need to use the received token.

 

Is anyone has an easy fix for that? I would appriciate that. Thanks.

----------------------------------------------------

My POST request in Power Query looks like this:

let
url = "url1",
headers = [#"Content-Type" = "application/x-www-form-urlencoded", #"Accept" = "*/*"],
postData = [
grant_type = "client_credentials",
client_id = "xxx",
client_secret = "xxx"
],
response = Json.Document(Web.Contents(url,
[
Headers = headers,
Content = Text.ToBinary(Uri.BuildQueryString(postData))
]))
in
response

As a result of the above I have received the access_token. But how should I continue in order to get data from the supplier's portal?

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

as you mention you need to present the token in the header of the GET request.

 

curl --request GET \
  --url2 'https://api.XXX' \
  --header 'Authorization: Bearer (token)'

 

xx = Web.Contents(url2,[Headers=[Authorization="Bearer " & token]])

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

as you mention you need to present the token in the header of the GET request.

 

curl --request GET \
  --url2 'https://api.XXX' \
  --header 'Authorization: Bearer (token)'

 

xx = Web.Contents(url2,[Headers=[Authorization="Bearer " & token]])

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.