Forum Discussion
TuanPham1999
7 years agoFrequent Visitor
Pull data from API using POST method in Power BI
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/to...
- 7 years ago
You may refer to the following post.
https://community.powerbi.com/t5/Desktop/Connect-to-a-Web-Service-sending-parameters/td-p/225510
Anonymous
6 years agoNot applicable
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
i4
2 years agoFrequent Visitor
How can I insert a variable (dateTo) instead of the date, i.e. 2024-12-31, into parameter5?
let
dateTo= DateTime.LocalNow(),
body = "{""parameter1"":""xxx"",""parameter2"":""xxx"",""parameter3"":""xxx"",""parameter4"":""xxx"",""parameter5"":""2024-12-31""}",
Data= Web.Contents("https://xxx",[Content=Text.ToBinary(body),Headers=[#"Content-Type"="application/json"]]),
DataRecord = Json.Document(Data),
Source=DataRecord
in
Source