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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
ResAPIToTheMoon
New Member

PowerBi - Rest API - Reports - Export To File using bookmarks

Dear community,

I am desperately trying to export a Power BI file, which is located in a Fabric environment, to a PDF using the REST API. The PBIX file contains a single page. This page has five bookmarks applied to it, each filtering the data based on a specific country.

Our goal is to reference each of these bookmarks and export them individually as PDFs, all based on the same report page. This works, for example, in Power Automate when I loop through the bookmark names extracted from the URL after publishing.

However, when we try the same approach in a Python notebook within Fabric, only the first page is exported, even if we explicitly specify a different bookmark.


Below you can find relevant code:

# Define the payload (body) for the export request
payload = {
    "format": "PDF",  
    "powerBIReportConfiguration": {
        "Bookmarks": {
            "name": bookmark_guid
        }
    }
}




1 ACCEPTED SOLUTION
ResAPIToTheMoon
New Member

The payload was not correct. This one works: 

    payload = {
        "format": "PDF",
        "powerBIReportConfiguration": {
            "defaultBookmark": { "name": bookmark_guid }
        }
    }

View solution in original post

3 REPLIES 3
ResAPIToTheMoon
New Member

The payload was not correct. This one works: 

    payload = {
        "format": "PDF",
        "powerBIReportConfiguration": {
            "defaultBookmark": { "name": bookmark_guid }
        }
    }
Anonymous
Not applicable

HI, @ResAPIToTheMoon 
We are very pleased to hear that the issue has been resolved. Thank you for sharing the solution with us. If you are willing, you might consider accepting this solution, as it can also help other community members facing the same issue find a solution more quickly.

vlinyulumsft_0-1740020287471.png

Of course, if there is anything else we can do for you, please do not hesitate to contact us. Once again, thank you for your contribution, and we look forward to your response.

 

Best Regards,

Leroy Lu

lbendlin
Super User
Super User

Have you tried the API call in the sandbox? Make sure your payload has the right format.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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