Forum Discussion

gilbertendaya's avatar
gilbertendaya
Helper IV
5 years ago

Get authorization token from API url

How can I get the authorization token value? I'm using advanced editor in power BI desktop.

I do have the generating token URL also the credentials (user and password).

 

let

GetJson = Web.Contents("<URL>",
[
Headers = [#"Accept"="application/json",
#"Content-Type"="application/x-www-form-urlencoded;charset=UTF-8"],
Content = Text.ToBinary("username=<username>&password=<password>&grant_type=password")
]
),
FormatAsJson = Json.Document(GetJson),
#"Converted to Table" = Record.ToTable(FormatAsJson),
#"Expanded Value" = Table.ExpandRecordColumn(#"Converted to Table", "Value", {"Data"}, {"Data"})
in
#"Expanded Value"

Anonymous  amitchandak tonmcg ImkeF