Forum Discussion
Get authorization token from API url
hi ImkeF thank you for the reply. Is there no easy way in M-query to do this?
hi ImkeF and amitchandak
do you know how to convert this to M-query?
- ImkeF5 years agoCommunity Champion
you can simply wrap it into a Json.Document-formula if you escape the quotes like so:
Json.Document( "{ ""limit"" : 10 , ""aggregate"" : [ { ""$sort"" : { ""dateProcessed"" : -1 } }, { ""$match"" : { } } ]}")If you have oauth, there is no simpler way in PQ, unfortunately.
- gilbertendaya5 years agoHelper IV
hi ImkeF amitchandak sorry again for the questions. Please see attached image. I was able to get the token and assigned it to a variable: authKey2 for Bearer Token.
Also added the body.
I encountered the error:
What is this error? Please advise.
Thank you always.
- ImkeF5 years agoCommunity Champion
Hi gilbertendaya ,
this is an authentication error.
I can only repeat that to my knowledge you cannot create an oauth flow without a custom connector in Power Query.
- gilbertendaya5 years agoHelper IV
sorry to know that ImkeF 😞
but I was able to do that from before
https://community.powerbi.com/t5/Desktop/Error-in-getting-POST-request-in-an-API/td-p/1026143/page/2I just don't know how to do it again 😞
- ImkeF5 years agoCommunity Champion
Hi gilbertendaya ,
sorry to hear. But the link you've provided does contain nothing that relates to authentication. So don't know how I could help here.