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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. 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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.