Forum Discussion

Williamlima's avatar
Williamlima
Frequent Visitor
6 years ago
Solved

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.

 

 

8 Replies

  • mwegener's avatar
    mwegener
    Most Valuable Professional

    Hi Williamlima ,

     

    the error message comes directly from the web source.

    I think there are more settings in Postman.

    • Williamlima's avatar
      Williamlima
      Frequent Visitor

      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's avatar
        mwegener
        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