Forum Discussion
Download report from "My Workspace" using REST API?
- 1 year ago
Hi Martin_D
I understand that the implementation did not work as expected.Currently, there isn't a specific documented or undocumented API for downloading reports from "My Workspace".
- Power BI APIs are generally more optimized for organizational workspaces rather than My Workspace. This can cause unexpected issues or limited functionality when trying to automate tasks for reports stored in My Workspace.
- Consider migrating the report to an organizational workspace to potentially resolve this issue.
If the issue persists, please consider raising a Microsoft support ticket for further assistance.Below is the link to create Microsoft Support ticket:
How to create a Fabric and Power BI Support ticket - Power BI | Microsoft Learn
If my response has resolved your query, please mark it as the Accepted Solution to help others. Additionally, I would appreciate a 'Kudos' if you found my response helpful.
Thank You.
Hi Martin_D
Thanks for reaching out to Microsoft Fabric Community Forum.
Unfortunately, REST API and PowerShell do not provide direct access to "My Workspace" for downloading reports due to the way permissions and access are managed.
However, Power Automate can be used as a workaround to export reports from "My Workspace.
- To do this, create a new flow in Power Automate and select the appropriate trigger.
- Next, add the "Export to File for Power BI Reports" action, select "My Workspace," and choose the report you want to export. Then, select the export format (e.g., PDF).
- Finally, add an action to send an email with the exported file as an attachment and test the flow to ensure it exports and saves the file correctly.
If you find this post helpful, please mark it as an "Accept as Solution" and give a KUDOS.
Thank You.
Are you sure about that? According to the API documentation, there are two different ones, where one provides access to My Workspace, and the other does not:
GET https://api.powerbi.com/v1.0/myorg/reports/{reportId}/Export
Exports the specified report from My workspace to a Power BI .pbix or .rdl file.
GET https://api.powerbi.com/v1.0/myorg/groups/{groupId}/reports/{reportId}/Export
Exports the specified report from the specified workspace to a Power BI .pbix or .rdl file.
You can run any REST API from PowerShell, for example, using Invoke-RestMethod.
- v-karpurapud1 year agoCommunity Support
Hi mariussve1
While it is technically correct that the first API endpoint can be used to access "My Workspace", there are practical challenges and limitations:- "My Workspace" is associated with the personal scope of the authenticated user. To access the endpoint successfully, the account used for authentication must have sufficient permissions and valid access tokens with the correct scopes.
- 403 Forbidden Errors: These errors typically occur if the authentication does not have the necessary permissions or scope for accessing personal workspaces.
- This might occur when using service principals or accounts that are not explicitly authorized to access "My Workspace."
- Invoke-RestMethod can indeed be used to call REST API endpoints, but the key challenge remains obtaining the appropriate access token and ensuring the request headers include the required authorization details.
- Martin_D1 year agoSolution Sage
Hi mariussve1 ,
Thank you for sharing this idea.
I tried, but when I authenticate with the user that owns the My Workspace containing the report I still get 403 forbidden.
Maybe this would be doable with a service principal with Admin consent? Unfortunatelly I don't have one to try myself.
Kind regards,
Martin