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.
Hi,
I need your help to find the exact syntax in order to get a refreshed token to connect to the Power BI Rest API with Power BI desktop.
I can get a temporary token using the try function with this link : https://learn.microsoft.com/en-us/rest/api/power-bi/reports/get-reports-in-group
But I need to dynamically refresh the token in order use the API with a valid token at each refresh.
I tried the code below but it doesn't work (changing the ***** and common with the tenant ID) :
the code :
() =>
let
body = "grant_type=Password&resource=https://analysis.windows.net/powerbi/api&client_id=****&username=***.onmicrosoft.com&password=*****",
Data=Json.Document(Web.Contents("https://login.microsoftonline.com/common/oauth2/token/", [Headers=[#"Content-Type"="application/x-www-form-urlencoded"], Content=Text.ToBinary(body)])),
access_token = Data[access_token]
in
access_token
many thanks for those who can help me.
Regards,
GJA
Solved! Go to Solution.
Or - you could use the convenient ready made connector. GitHub - migueesc123/PowerBIRESTAPI: A Microsoft Power BI Data Connector or Power Query Connector fo...
Or - you could use the convenient ready made connector. GitHub - migueesc123/PowerBIRESTAPI: A Microsoft Power BI Data Connector or Power Query Connector fo...
Hi, many thanks. It looks OK
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 |
---|---|
65 | |
63 | |
52 | |
37 | |
36 |
User | Count |
---|---|
82 | |
66 | |
61 | |
46 | |
45 |