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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.