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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors