Quantcast
Channel: All Developer posts
Viewing all articles
Browse latest Browse all 48143

Re: Connect with SAP R/3 module using Power BI

$
0
0

Here's a sample sending a request with JSON in the body which works in my test before this post. You Power Query code looks good. As the response message shows "invalid input parameters", I'd doubt you've not sent every parameter the API expects.

 

I'm not familiar with your SAP R/3 web service, just ensure that the API can be accessed in other API test tools, like POSTMAN. After that you can tweak the API by using Power Query.

 

let
    AuthKey = "Bearer youTokenHere",
    url = "https://api.powerbi.com/v1.0/myorg/datasets",
    body = "{""name"": ""SalesMarketing2"",""tables"":   
    [{""name"": ""Product"", ""columns"":   
        [{ ""name"": ""ProductID"", ""dataType"": ""Int64""},  
         { ""name"": ""Name"", ""dataType"": ""string""},  
         { ""name"": ""Category"", ""dataType"": ""string""},  
         { ""name"": ""IsCompete"", ""dataType"": ""bool""},  
         { ""name"": ""ManufacturedOn"", ""dataType"": ""DateTime""}  
        ]  
      }  
    ]  
}",
    Source = Json.Document(Web.Contents(url,[
         Headers = [#"Authorization"=AuthKey ,
                    #"Content-Type"="application/json"],
         Content = Text.ToBinary(body) 
             ]   
        ))
in
    Source

 


Viewing all articles
Browse latest Browse all 48143

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>