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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
plugin
Regular Visitor

Export shared report to file using REST API - 401: GroupNotAccessible

The situation: 
The report is shared with the user. Workspace is not shared.
So, the user has access to the report on Power Bi Coud.

At the same time, the user can't export the report to a file using the API call https://learn.microsoft.com/en-us/rest/api/power-bi/reports/export-to-file-in-group

The response code is 401 and the headers are:

content-length: 0
requestid: 5dc35063-3e7e-45af-85d1-хххххххххх
x-powerbi-error-info: GroupNotAccessible

 

The question:
Does anybody can share the documentation where this limitation is described? Or is this the wrong API behavior? 

1 ACCEPTED SOLUTION
hackcrr
Solution Supplier
Solution Supplier

Hi, @plugin 

The behavior you are experiencing is due to the permission model in Power BI. In Power BI, access to reports is controlled by workspace-level permissions. If users can only access shared reports and not the entire workspace, they will not be able to perform certain actions, such as exporting a report to a file using the REST API. This limitation is due to the fact that the API call to export a report relies on access to the workspace containing the report.

To use the export-to-file-in-group API, the user needs access to the workspace where the report is located. This is because the API operates at the workspace level (called "group" in the API endpoint), which you can refer to the official documentation:

https://learn.microsoft.com/en-us/power-bi/collaborate-share/service-new-workspaces

The Power BI REST API documentation outlines that certain operations require specific permissions. Exporting a report to a file requires that the user has the right to read the report and access the workspace it contains.

https://learn.microsoft.com/en-us/rest/api/power-bi/reports/export-to-file-in-group

hackcrr_0-1715865461609.png

This 401 Error: GroupNotAccessible error indicates that the user is not authorized to access the workspace (group) in which the report resides. This error indicates that there is a permissions issue where the API does not have access to the workspace context required to perform the export operation.

To resolve this issue, the user needs to be granted at least Viewer access to the workspace containing the report.

 

Best Regards,

hackcrr

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

1 REPLY 1
hackcrr
Solution Supplier
Solution Supplier

Hi, @plugin 

The behavior you are experiencing is due to the permission model in Power BI. In Power BI, access to reports is controlled by workspace-level permissions. If users can only access shared reports and not the entire workspace, they will not be able to perform certain actions, such as exporting a report to a file using the REST API. This limitation is due to the fact that the API call to export a report relies on access to the workspace containing the report.

To use the export-to-file-in-group API, the user needs access to the workspace where the report is located. This is because the API operates at the workspace level (called "group" in the API endpoint), which you can refer to the official documentation:

https://learn.microsoft.com/en-us/power-bi/collaborate-share/service-new-workspaces

The Power BI REST API documentation outlines that certain operations require specific permissions. Exporting a report to a file requires that the user has the right to read the report and access the workspace it contains.

https://learn.microsoft.com/en-us/rest/api/power-bi/reports/export-to-file-in-group

hackcrr_0-1715865461609.png

This 401 Error: GroupNotAccessible error indicates that the user is not authorized to access the workspace (group) in which the report resides. This error indicates that there is a permissions issue where the API does not have access to the workspace context required to perform the export operation.

To resolve this issue, the user needs to be granted at least Viewer access to the workspace containing the report.

 

Best Regards,

hackcrr

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.