Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi Team,
How to call or consume POST Rest API service in Power BI web Kindly help me to resolve, GET method working properly but post method I am facing the error
HI d_gosbell
As you mentioned I have made the changes but still, I am facing the issue Please find my code, kindly do the needful
let
Source = Json.Document(Web.Contents("https://tmpldev.chainsys.com/apppublisher/rest/dataexchangerestpublisher/dataExchangeJsonExecution/X...",
[Headers=[Authorization="Basic bWFyaWFuaXRoaTpXZWxjb21lIzE="]])),
Body = "{""parameters"" : {""recordsPerBatch"" : 10}}"
in
Source
You have not passed the Content= parameter in the options for the Web.Content call so your code will be doing a GET, not a POST. Maybe it should be something like the following
let
Source = Json.Document(Web.Contents("https://tmpldev.chainsys.com/apppublisher/rest/dataexchangerestpublisher/dataExchangeJsonExecution/X...",
[Headers=[Authorization="Basic bWFyaWFuaXRoaTpXZWxjb21lIzE="], Content = "{""parameters"" : {""recordsPerBatch"" : 10}}" ])),
in
Source
Hi d_gosbell,
Now I am Getting the bellow error , kindly do the needful
Expression.Error: We cannot convert the value "{"parameters" : {"re..." to type Binary.
Details:
Value={"parameters" : {"recordsPerBatch" : 10}}
Type=[Type]
So if the POST is expecting binary data try wrapping the content in the Text.ToBinary() function.
eg.
let
Source = Json.Document(Web.Contents("https://tmpldev.chainsys.com/apppublisher/rest/dataexchangerestpublisher/dataExchangeJsonExecution/X...",
[Headers=[Authorization="Basic bWFyaWFuaXRoaTpXZWxjb21lIzE="],
Content = Text.ToBinary( "{""parameters"" : {""recordsPerBatch"" : 10}}" ) ])),
in
Source
Hi d_gosbell,
I am getting the bellow error kindly do the needful please.
let
url = "https://tmpldev.chainsys.com/apppublisher/rest/dataexchangerestpublisher/dataExchangeJsonExecution/X...",
Source = Json.Document(Web.Contents(url, [#"Headers"=[Authorization="Basic bWFyaWFuaXRoaTpXZWxjb21lIzE="],
Content = Text.ToBinary( "{""parameters"" : {""recordsPerBatch"" : 10}}" ) ]))
in
Source
I don't know what the problem is there. It looks like the request is working, but not returning any data. Does it work if you use another client like Postman to test the API?
Hi, d_gosbell,
As you suggested I have installed the fiddler and tested here is the result,
Post man request,
Power BI request
if you need any other information please let me know
Hi d_gobell,
Yes, I did its working please find the screen shot below
So you might need to use something like Fiddler to capture the call from Power BI and Postman and compare them to see what is different.
Hi d_gosbell,
As you suggested I have installed the fiddler and tested here is the result,
I can able see the result form postman
Postman request 1,
Postman request 2
Power BI request 1
Power BI request ..2
HI d_gosbell
I have tried with code which you have mentioned in the previous conversation, I am getting the below error , when I tried with anonymously which is through the error as
when I tried with Basis authentication which is through the error as
so that would have been helpful information to include in your original post.
You can manually encode the basic authentication credentials using the technique outlined here
You would use an anonymous authentication type, but then pass through the Headers= option as in the above post to pass through the basic credentials and then also use the Content= to make the request a POST request.
As shown in the second example for the Web.Contents function when you specify the Content= parameter the request is sent as a POST see https://docs.microsoft.com/en-us/powerquery-m/web-contents#example-2
If you need more help you will need to explain to us what code you are running and show us the actual error message.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.