Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Is there any way to retrieve a token (providing a user/pass/grant-type as a urlencodedform) from a RESTful API, and then provide that token with subsequent API calls? We have a large RESTful API that we would like to tap into by harnessing Power BI, but I cannot find any documentation on how to achieve this. Plenty of documentation on connecting to a public REST API...
Thanks!
Solved! Go to Solution.
Hi @adam3039,
According to your description, you want to get the token of restful api, right?
You can write a power query function to get token,then use this function as the parameter to call the api.
For detail information about get token, you can refer below article:
REST API Token-based Authentication
Call API Sample:
let CallAPi= ( URI as text, Username as text, Token as text, Paremeter as table, optional Timeout as number ) as any => let WebTimeout = if Timeout = null then #duration(0,0,0,100) else #duration(0,0,0,Timeout) , WebServiceContent = function(Paremeter),//format parameters to content WebResponse = Web.Contents(Username&":"&Token&URI, [Content = Text.ToBinary(WebServiceContent), Headers = [Authorization="xxxxx", #"Content-Type"="application/json", Accept="application/json"], Timeout = WebTimeout]), output = formatfunction(WebResponse) //format the response in output in CallAPi
Regards,
Xiaoxin Sheng
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
80 | |
78 | |
58 | |
36 | |
33 |
User | Count |
---|---|
93 | |
59 | |
56 | |
49 | |
41 |