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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Noeleke1301
Helper II
Helper II

[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
Employee
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 II
Helper II

Nobody who can help me with this issue?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.