Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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?
Solved! Go to Solution.
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]])
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]])
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 5 | |
| 4 | |
| 3 |
| User | Count |
|---|---|
| 15 | |
| 14 | |
| 11 | |
| 8 | |
| 8 |