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

Join 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.

Reply
Mani008
Frequent Visitor

PowerBI API - Bad Response 400 - Python

Hi Members, 

 

I am using PowerBI API to pull admin related data like workspaces , reports , datasources, etc. I have used OAuth2 method to sign in and get the response in python. It was working till last week , but now script starts to throw - Response 400. 

 

My user works fine in power BI api Try it - focus mode. 

Any suggesstions on this ? I have tried to connect using service prinicipal method, but no luck .  

Do this have something to do with my power BI license . I have Pro license . 

 

Mani008_0-1664521197762.png

 

Cheers, 

Mani

1 ACCEPTED SOLUTION
Mani008
Frequent Visitor

I didn't add the Service Principal as memeber to the security group . After adding that , the api response works fine with using Service Principal Method .  

 

Detailed steps are here : https://data-goblins.com/power-bi/power-bi-api-python 

 

View solution in original post

3 REPLIES 3
Mani008
Frequent Visitor

I didn't add the Service Principal as memeber to the security group . After adding that , the api response works fine with using Service Principal Method .  

 

Detailed steps are here : https://data-goblins.com/power-bi/power-bi-api-python 

 

Mani008
Frequent Visitor

@lbendlin Thanks for your response. I have tried changing the scope (

'scope': 'https://api.powerbi.com') , still it gives 400 response. This will not create any access token to validate.   
lbendlin
Super User
Super User

Check your token at jwt.io  - the scope "all" is most likely not accepted.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.