Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Williamlima
Frequent Visitor

GET Request o Power BI

Hey guys,

 

So I looked in a bunch of earlier posts and still didn't' manage to make my GET request work on power BI, the configs on Postman goes like this:

 

Header: http://redentor.inlog.com.br:18090/dashboard/rest/exportarrelatorio

Body: {"Relatorio":"Consumo Média Planejada","Autenticacao":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","NomeBanco":"dashboard_inlog","Formato":"chavevalor"}

 

So I test it on Postman and works like a charm, but on power Query it gives me the same error"

O nome do banco de dados é obrigatório.

 wich roughly translates to "The database name is required". i have the database name on the request's body in Power Bi like this:

 

let
Fonte = Json.Document(Web.Contents("http://redentor.inlog.com.br:18090/dashboard/rest/exportarrelatorio", [Headers=[ContentType="application/json"]])),
body = "{""Relatorio"":""Consumo Média Planejada"",""Autenticacao"":""e0d86d356d02b3b8107d5b5015800731"",""NomeBanco"":""dashboard_inlog"",""Formato"":""chavevalor""}"
in
Fonte

 

 

Am i making something wrong? or is it incomplete? Im new to power BI so any help would be appreciated.

 

Thanks in advance.

 

 

1 ACCEPTED SOLUTION
mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Williamlima ,

 

here your PBIX

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


View solution in original post

8 REPLIES 8
mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Williamlima ,

 

the error message comes directly from the web source.

I think there are more settings in Postman.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Hey  

 

 

 

The way i see, i'm making something wrong on power BI, can u please help me figure it out what it is?

mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Williamlima ,

 

if the body is to be transmitted, it must also be part of the webcall.

let
    Json = "{""NomeBanco"":""dashboard_inlog"",""Relatorio"":""Consumo Média Planejada"",""Autenticacao"":""e0d86d356d02b3b8107d5b5015800731"",""Formato"":""chavevalor""}",
    ToJsonBinary = Json.FromValue(Json),
    WebCall = Web.Contents("http://redentor.inlog.com.br:18090/dashboard/rest/exportarrelatorio", [Content = ToJsonBinary]),
    LinesFromBinary = Lines.FromBinary(WebCall)
in
    LinesFromBinary

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


 , good morning.

 

First of all I would like to thank you for helping me out, second of all I must say that I made a little confusion on the requested method and its POST not GET and i learned a very important lesson today.

 

So, i managed to make the call work because Power Bi request is a GET by default and mine is a POST. So my query looks like this now:

 

let

url = "http://redentor.inlog.com.br:18090/dashboard/rest/exportarrelatorio",
body = "{""Relatorio"":""Controle de Desconexões de Equipamentos - MID/AVL"",
""Autenticacao"":""e0d86d356d02b3b8107d5b5015800731"",
""NomeBanco"":""dashboard_inlog"",
""Formato"":""chavevalor""
}",


Source = Json.Document(Web.Contents(url,[
Headers =[#"Content-Type"="application/json"],
Content = Text.ToBinary(body)
]
)),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error)


in
#"Converted to Table"

 

The way I see, im converting the content to binary but i don't know how to convert back to text. Can you still help me out?.

 

Thank you.

mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Williamlima,

 

your result looks good to me

Webcall.png

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


 

 

mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Williamlima ,

 

here your PBIX

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


  ,

 

Thanks a lot, it really helped me out.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.