Quantcast
Channel: All Power Query posts
Viewing all articles
Browse latest Browse all 122374

Re: Connect with secure JSON source

$
0
0

netwire,

 

for your API example below use Get Data - Web - in Power Bi Desktop. http://api.nobelprize.org/v1/laureate.json

 

or use this 

 

let
    Source = Json.Document(Web.Contents("http://api.nobelprize.org/v1/laureate.json")),
    laureates = Source[laureates],
    #"Converted to Table" = Table.FromList(laureates, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"id", "firstname", "surname", "born", "died", "bornCountry", "bornCountryCode", "bornCity", "diedCountry", "diedCountryCode", "diedCity", "gender", "prizes"}, {"id", "firstname", "surname", "born", "died", "bornCountry", "bornCountryCode", "bornCity", "diedCountry", "diedCountryCode", "diedCity", "gender", "prizes"})
in
    #"Expanded Column1"

for basic auth API, use something like this. 

 

let
 authKey = "{""Username"":""USERNAME"",""Password"":""PASSWORDGOESHERE"",""LocationID"":""LOCATIONIFNEEDED""}",
 url = "https://APILINKGOESHERE.com",
 // Uses the authentication/token method to obtain a token
 GetJson = Web.Contents(url,
     [
         Headers = [#"Content-Type"="application/json"],
         Content = Text.ToBinary(authKey),
         RelativePath="/Authentication/AuthorizeUser"
     ]
 )
in
    GetJson

 


Viewing all articles
Browse latest Browse all 122374

Trending Articles



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