The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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