Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi all, I'm a fresher in Power BI Desktop. my mission is extract data from given credentials include: ClientID, Password and Url. The credentials must be Base64 encoded for use in the POST /oauth2/token request. I have used that credentials in Postman and I got its header such as: Authorization: Basic xxxxxxxxxxxxxxxxxxxxxx. what should i start with all of them to get data from API. Can anyone help me to solve this probleml. thank you so much for any solution and suggestion. Cheer!!!
Solved! Go to Solution.
You may refer to the following post.
https://community.powerbi.com/t5/Desktop/Connect-to-a-Web-Service-sending-parameters/td-p/225510
I found it not so easy to get data via POST so I am pasting here what I did in case this helps someone else in the future.
I created the following blank query:
= let
body = "The POST method body here",
Data= Web.Contents("https://yourusrlhere",[Content=Text.ToBinary(body),Headers=[#"Content-
Type"="application/json"]]),
DataRecord = Json.Document(Data),
Source=DataRecord
in
Source
I wanted to post a more complete/cleaner version of the above solution that contains multiple headers and shows how to convert the body to binary data for POST operations:
let
url = "https://api.somevendor.com/api/",
headers = [#"Content-Type" = "application/x-www-form-urlencoded", #"Accept" = "application/json"],
postData = "Any sort of text data you want to post to the API",
response = Web.Contents(
url,
[
Headers = headers,
Content = Text.ToBinary(postData)
]
),
jsonResponse = Json.Document(response)
in
jsonResponse
What body = "The POST method body here", is for?
Thanks
Hi all, I'm a fresher in Power BI Desktop. my mission is extract data from given credentials include: ClientID, Password and Url. The credentials must be Base64 encoded for use in the POST /oauth2/token request. I have used that credentials in Postman and I got its header such as: Authorization: Basic xxxxxxxxxxxxxxxxxxxxxx. what should i start with all of them to get data from API. Can anyone help me to solve this probleml. thank you so much for any solution and suggestion. Cheer!!!
You may refer to the following post.
https://community.powerbi.com/t5/Desktop/Connect-to-a-Web-Service-sending-parameters/td-p/225510
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
83 | |
70 | |
61 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |