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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
rohith351
Regular Visitor

Error while calling POWER BI REST API without USER-ID and PASSWORD

Hai Guys,
I created an app in the Azure Active Directory (AD) and gave required Power Bi API permissions.
I am calling API from Python using HTTP Requests.
But when authenticating the token for API'S with user-id and password it works fine, I get the token and I get 200 as status code for my API.
But when I am not using user-id and password, I get the token but when I am using token to call API, it is throwing an error 403:-  "API IS NOT ACCESSIBLE FOR APPLICATION" and "PowerBINotAuthorizedException".
I tried many ways by added security groups in developer options in powerbi web. But No use.
Please help me if you have any ideas about how to solve these kinds of errors.
We should not use user-id and password while we call APIS

5 REPLIES 5
Anonymous
Not applicable

@rohith351 

Hi Rohit

did you ever get this PowerBI rest API calls resolved.

 

I am trying to access audit logs using MSAL library in Python with "Application Permissions". I am getting the access token but when trying to get request running into below error. The AD App was given admin previlieges on PowerBI service too.

 

{'error': {'code': 'PowerBINotAuthorizedException', 'pbi.error': {'code': 'PowerBINotAuthorizedException', 'parameters': {}, 'details': [], 'exceptionCulprit': 1}}}

Were you able to resolve this?
I am running into the same error.

Anonymous
Not applicable

try follow this article https://pivotalbi.com/automate-your-power-bi-dataset-refresh-with-python/

 

"The Power BI REST API only supports delegated permissions. That means that you need to run any calls to the REST API in the context of a user"

Thanks AlexanderTikh for the reply,

I find this blog already but the thing is that by using the token returning from using service principel  is working but there are some limitations while we calling API onto PowerBi.

Anonymous
Not applicable

I had the same error

{'error': {'code': 'PowerBINotAuthorizedException', 'pbi.error': {'code': 'PowerBINotAuthorizedException', 'parameters': {}, 'details': [], 'exceptionCulprit': 1}}}

it was problem with adding correct permission to service principal, should be like described in docs, in my case I had to add Delegated  type of permissons. 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.