Forum Discussion
Arya_A_R
1 year agoRegular Visitor
Trying to query data with python scripts using power bi rest api
i was trying to access one of the dataset pubhlished in workspace through power bi rest api where i have admin privileges.The error recieved is "403". Below mentioned is the code used to excute t...
- 1 year ago
You’re getting 403 because you’re using an embed token — that only works for embedding, not for REST API queries.
Fix: Use an Azure AD access token (via MSAL) with scope
https://analysis.windows.net/powerbi/api/.defaultThen call executeQueries directly with that token.
Remove the GenerateToken step.
Shahid12523
Community Champion
1 year agoYou’re getting 403 because you’re using an embed token — that only works for embedding, not for REST API queries.
Fix: Use an Azure AD access token (via MSAL) with scope
https://analysis.windows.net/powerbi/api/.default
Then call executeQueries directly with that token.
Remove the GenerateToken step.