3
votes

I want to embed Power BI non-group workspace report in my application i.e., the reports that I have created or are shared with me and are not published to any workspace. I gone through the articles for embedding the report but didn't find any matching my scenario.

For embedding report, we need Embedded Token, for this I'm making a POST request to Power BI Rest API with the URL

https://api.powerbi.com/v1.0/myorg/reports/{reportId}/GenerateToken

Using the above request, I'm getting the response code 403 and error {"error":{"code":"InvalidRequest","message":"Embedding isn't supported for non-group workspace"}}.

Is there any way to generate embed token for reports or dashboards that are not in any workspace.

1

1 Answers

2
votes

I ran into the same issue. Seems however you will need to place the report into a workspace. Whether manually or by cloning.

It is odd to expose an endpoint that does not work to generate a token for a report, but the documentation does specifically say:

This functionality is only available in a workspace context. Use Reports GenerateTokenInGroup.

NOTE: With regards to cloning, although not stated clearly in the documentation it seems if you clone to a different workspace (targetWorkspaceId in request) you also need to provide the target dataset (targetModelId in request). If you don't have a dataset to use an alternative to cloning would be to Export the report and then to Import it which will create a dataset