Forum Discussion
PowerBI API ExportTo individual page/visual
- 4 years ago
The pagename is likely not what you think it is. It is more of a GUID based identifier. If you don't specify the right pagename the export will ignore your request and give you all pages.
Unfortunately the main documentation Reports - Export To File In Group - REST API (Power BI Power BI REST APIs) | Microsoft Docs is not very helpful. However, there's this : Export Power BI embedded analytics reports API - Power BI | Microsoft Docs which gives you the hint on how to fetch the page names via a different API call.
The pagename is likely not what you think it is. It is more of a GUID based identifier. If you don't specify the right pagename the export will ignore your request and give you all pages.
Unfortunately the main documentation Reports - Export To File In Group - REST API (Power BI Power BI REST APIs) | Microsoft Docs is not very helpful. However, there's this : Export Power BI embedded analytics reports API - Power BI | Microsoft Docs which gives you the hint on how to fetch the page names via a different API call.
Hello!
Thank you for your reply! I used the Get Pages API Endpoint and I noticed that it gave both a "Name" and a "Display Name", just like you mentioned. I tried running the same code using the GUID-like given to me by the API, but I still get all of the pages in the report.
Could I be missing something in the payload that makes the API ignore it?
- lbendlin4 years agoSuper User
You can use the sandbox to try the API call in the service. That helps with the debugging.
- Anonymous4 years agoNot applicable
So I have found the issue by pure luck. I was using Python's requests package to send the requests, and the payload was written as a Python dictionary and given to the package, since that work usually.
Apparently, this endpoint does not like that and I had to write it as a JSON string and pass it like that.
- jbronzo2 years agoNew Member
can you share the payload for the report configuration to isolate just a single visual? I am working on the same use case. Thank you