Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Having trouble authenticating to Power BI via API. Uusually pretty good at finding some help online, but there are many different explanations on how to do this, and alot of them are historic.
My setup and testing so far:
I have an app registration, setup with delegated permissions. ( Likely too may permissions ).
I'm able to get an access token by authenticating with client id and secret, by using the .default scope.
( Maybe the wrong scope and grant type here, but only way I can get a token).
From here, I attempted to use this token to make a POST request to the Power BI EndPoint.
https://api.powerbi.com/v1.0/myorg/groups/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/datasets
However, I only ever get a 403.
I found another post on this forum where another user had this same issue, but seems either outdated or not applicible to what I am trying to do.
https://community.powerbi.com/t5/Developer/Access-Power-BI-API-with-Python/m-p/189165#M6015
Any ideas on what I'm doing wrong here?
Thanks. Yea, I guess I just don't understand how the scopes work. Have granted the app registration the API permissions and aquired the token with the app registrations ClientID and Secret. I would think that it would get the correct scopes.
Only thing that I can think of is that the user delegation is missing. Will keep hunting I guess.
Check your token at jwt.io - most likely it has the wrong or insufficient scope.
Thanks for the reply. I did check, and noticed that the decoded token doens't contains any scopes.
When I request the token, I have been using .default. Do you know if this may be the problem?
Yes, that is the issue. If you get a token via a different process (powershell for example) and examine it you will see it has all the scopes, and it works. No scope = no work. The .default thing fails somewhere but I don't understand where. Nobody was able to explain that to me yet.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 3 | |
| 3 | |
| 2 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |