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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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