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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. 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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon & SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.