Forum Discussion
Export paginated report to file forbidden
- 3 years ago
When ever you call a Power BI API you need to send an authorization header with a token. It's not specific for this API.
Otherwise Power BI cannot know who's sending the request, and validate the permissions.
H,
Are you saying that you're able to embed the report with your Service Principal? If so, then it means you've added the service principal to the report's workspace in Power BI, or otherwise the call to generate the embed token should've failed.
In that case the same Service Principal should be able to call the "Export to File" API (same AAD bearer token).
- Grasmachien3 years agoFrequent Visitor
Hi AmosHersch,
I'm a developer and I have no idea how Power BI works.
I assume you are right about the Service Principal.
So if I understand correct I should be able to add an Authorization header to the call with the same access token in order to get the permissions to export?Is there any documentation about this?
There does not seem to be anything on this in the docs: https://learn.microsoft.com/en-us/power-bi/developer/embedded/export-paginated-report
- AmosHersch3 years ago
Microsoft Employee
When ever you call a Power BI API you need to send an authorization header with a token. It's not specific for this API.
Otherwise Power BI cannot know who's sending the request, and validate the permissions.