Forum Discussion
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
13 Replies
- amitchandakSuper User
gilbertendaya , refer if these can help
https://www.youtube.com/watch?v=f7HLyiAk-lQ
https://community.powerbi.com/t5/Desktop/Connect-to-data-with-API-token/td-p/731867
https://docs.microsoft.com/en-us/rest/api/power-bi/embedtoken
https://docs.microsoft.com/en-us/power-bi/developer/embedded/get-azuread-access-token
- gilbertendayaHelper IV
Thank you for the response amitchandak but I still don't get it.
What is wrong with my M-query?
Please advise.
Thank you.
- amitchandakSuper User
gilbertendaya , refer the m code used in
https://chris.koester.io/index.php/2015/07/16/get-data-from-twitter-api-with-power-query/