Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
MD39
New Member

Rest API Access token using OAuth Token

I'm trying to pull data using basic REST API calls, for example, https://api.powerbi.com/v1.0/myorg/admin/reports. When I go through https://learn.microsoft.com/en-us/rest/api/power-bi/admin/reports-get-reports-as-admin

 

I am using Alteryx to download and parse the data, and when downloading using the API and getting the bearer token from https://learn.microsoft.com/en-us/rest/api/power-bi/admin/reports-get-reports-as-admin it works and returns the data I need. However, I need to automate this so in my workflow, I want to pull a new access token when I run my workflow to use in any subsequent API calls. So, I have created an app in my azure portal and trying to call https://login.microsoftonline.com/{tenant id}/oauth2/v2.0/token for my authorization token to use in my get reports apiWhen I use that access token I receive a 403 error. Below is the post call i'm using to get the access token.

MD39_0-1702328389328.png

I've also tried using login.windows.net and this allowed me to use password as a grant_type and provided both an access and refresh token, yet both of those didn't work as expected.

MD39_1-1702328636696.png

My end goal, is to have a workflow that goes and gets the bearer authorization token to use for several calls available here

MD39_2-1702328881845.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @MD39 ,

 

Based on my testing, even if you successfully generate an AAD token, the content permissions that your token can access are still determined by the value defined in the scope parameter, so if you want to run the Power BI API, you can try to define and fill in the scope parameter with this value

https://analysis.windows.net/powerbi/api/.default

vyangliumsft_0-1702364862353.jpeg

At the same time, you can also make sure that the required scope of the application used to generate the token has been filled in using the delegated.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi  @MD39 ,

 

Based on my testing, even if you successfully generate an AAD token, the content permissions that your token can access are still determined by the value defined in the scope parameter, so if you want to run the Power BI API, you can try to define and fill in the scope parameter with this value

https://analysis.windows.net/powerbi/api/.default

vyangliumsft_0-1702364862353.jpeg

At the same time, you can also make sure that the required scope of the application used to generate the token has been filled in using the delegated.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.