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
Noeleke1301
Helper III
Helper III

[403] error on ExportToFile API request

Hi all,

 

I keep getting a 403 response on my attempt to export a report to PDF in a Python script.

  • The report is published in a fabric trial workspace, so it is dedicated
  • All permissions are set correctly in my Azure app
  • I'm using clientId and client secret value for authentication
  • I can see in Azure that my authentication is succesful every time
  • I'm getting a token as response on the GenerateToken API, but when I use this token to trigger the ExportToFile, I get 403
  • When I use the "try out" button on the API documentation page and use that given bearer token in my script, everything works fine

Below permissions in my Azure app (they are not available as 'application'  permission, only as delegated):

Noeleke1301_0-1699514350756.png

 

What's happening here and how can I solve this problem?

 

Thanks.

3 REPLIES 3
AmosHersch
Microsoft Employee
Microsoft Employee

Hi @Noeleke1301 ,

 

You wrote: I'm getting a token as response on the GenerateToken API, 

Do you refer to the API for generating an embed token? The call to the "Export to File" API should be done with an AAD token (like any other API).

Did you check in the reponse message has additional information in the message body besides the returned error code?

I've solved it now by changing the grant_type to 'password'.

Noeleke1301
Helper III
Helper III

Nobody who can help me with this issue?

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.

Top Solution Authors