Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now
Hi,
We are using PowerBI Pro.
We want to utilise the PowerBI rest API to export reports as PNG files and to email these out to customers.
Is this possible to do using the REST API:
POST https://api.powerbi.com/v1.0/myorg/reports/{reportId}/ExportTo
Do I need to be on Priemum Capacity in order to achieve this?
Thanks,
Solved! Go to Solution.
Hi @VendettaBob ,
Official article announced on March 6, 2020 that allowed you to export a Power BI report by using a REST call, to the following file formats: PDF, PPTX (PowerPoint) and PNG.
Send to print button – In your application, create a button that when clicked on triggers an export job. The job can export the viewed report as a PDF or a PPTX, and when it’s complete, the user can receive the file as a download. As the API is asynchronous, it may take some time for the file to be available.
Email attachment – Send an automated email at set intervals, with an attached PDF report. This scenario can be useful if you want to automate sending a weekly report to executives.
When the Export-To-File API is called, it triggers an export job. After triggering the export job, you can use the Polling API to track the job until it is complete. When the export job is complete, the Polling API call returns a Power BI URL for getting the file (The URL is available for 24 hours). The API supports concurrent export job requests. The number of jobs you can run at the same time, depends on the SKU your report resides on, as detailed in this table.
Wish it is helpful for you!
Best Regards
Lucien
Hi @VendettaBob ,
There is a limitation on this article:
Limitations: Premium Per User (PPU) is not supported.
So I assume Pro is not supported too:
https://docs.microsoft.com/en-us/rest/api/power-bi/reports/exporttofile
Hi @VendettaBob ,
Yes, otherwise the following error will be reported:
{
"error": {
"code": "InvalidRequest",
"message": "Report requested for export is not on dedicated capacity"
}
}
Best Regards
Lucien
Hi @VendettaBob ,
Official article announced on March 6, 2020 that allowed you to export a Power BI report by using a REST call, to the following file formats: PDF, PPTX (PowerPoint) and PNG.
Send to print button – In your application, create a button that when clicked on triggers an export job. The job can export the viewed report as a PDF or a PPTX, and when it’s complete, the user can receive the file as a download. As the API is asynchronous, it may take some time for the file to be available.
Email attachment – Send an automated email at set intervals, with an attached PDF report. This scenario can be useful if you want to automate sending a weekly report to executives.
When the Export-To-File API is called, it triggers an export job. After triggering the export job, you can use the Polling API to track the job until it is complete. When the export job is complete, the Polling API call returns a Power BI URL for getting the file (The URL is available for 24 hours). The API supports concurrent export job requests. The number of jobs you can run at the same time, depends on the SKU your report resides on, as detailed in this table.
Wish it is helpful for you!
Best Regards
Lucien
Hi,
is this API can only be used using C# code as mentioned in sample code
or i can use this REST with any form of language like NODE.js?
@v-luwang-msft
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.