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 guys,
I'm new to PowerBI and I have a question regarding Post request method,
we have a service API that we like to use PowerBI to connect to get data where clients and do reporting,
we tried to setup a connection between powerbi desktop and our API through Post request
What we have problem is where do I put in the values for individual key and how do I also send in a request body that's recognized by PowerBI?
Thanks
Hi @newuserpowerbi,
Based on my research, the PostContents is JSON format, try to specify
Headers=[#"Content-Type"="application/json"]
What do you mean about the individual key, is it authentication key? If yes, the formula(M) below is for your reference.
let AuthKey = "abc", url = "efg", Source = Json.Document(Web.Contents(url,[ Headers = [#"Authorization"=AuthKey , #"Content-Type"="application/json"], Content = Text.ToBinary(body) ] )) in Source
Regards
Hi guys,
I'm new to PowerBI and I have a question regarding Post request method,
we have a service API that we like to use PowerBI to connect to get data where clients and do reporting,
we tried to setup a connection between powerbi desktop and our API through Post request
let
body = "{""username"": ""xxxxxxxxx"",""password"": ""xxxxxxx"",""grant_type"": ""password"",""something"": ""test"",""clientsomething"": ""passwordhere"",}",
url = "https://xxxxxxxxxxxx/token",
GetJson = Web.Contents(url, [
Headers = [#"Content-Type"="application/x-www-form-urlencoded"],
Content = Text.ToBinary(body)
])
in
GetJson
We can get into the api and see some value but what we have problem is where do I put in the values for individual key and how do I also send in a request body that's recognized by PowerBI?
Thanks
Hi @v-ljerr-msft,
Thank you for your reply, we did tried to get that in the body,
we still are not able to send in a request body on http post request
at the end that has keys and values (example below)
we need to get a token in response from our authentication service
Actual Code:
let
body = "{""a key here"": ""a value here"",""the next key"": ""password"",""grant_type"": ""password"",""client_id"": ""Test"",""client"": ""password"",}",
url = "https://xxxxxxxx.com/token",
GetJson = Web.Contents(url, [
Headers = [#"Content-Type"="application/x-www-form-urlencoded"],
Content = Text.ToBinary(body)
])
in
GetJson
Thank you for your help
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 |
---|---|
60 | |
20 | |
18 | |
18 | |
9 |