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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.