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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
namnguyenthanh
New Member

Unable to get the embed url from Get Report API

Hi everyone,

 

Currently, I've been trying to get the embed url of reports that I was shared via a link by using the API https://docs.microsoft.com/en-us/rest/api/power-bi/reports/get-report, and the report I want to get  the embed url is shared for everyone in my organisation, the problem is that the first time I tried to make a call to the API using ReportID to get the embed url, it returned 404, however, when I opened and viewed the report via a link on the site https://app.powerbi.com/, I was able to make a call to the API and got the embed url.

 

To clarify the steps that I encountered the problem:

 

1. Got the shared report via a link, extracted ReportID from the link (didn't open and view the report on the site https://app.powerbi.com/ yet)

2. Made a call to API https://api.powerbi.com/v1.0/myorg/reports/{reportId} with the extracted ReportID from the link and got 404

3.  Opened and viewed the report on the site https://app.powerbi.com/

4. Retired the step 2.

5. Got the embed url without any issues.

 

Does anyone encounter the same problem?

 

Cheers,

Nam

2 ACCEPTED SOLUTIONS

Hi. I understand. However, have you tried the get reports in group? I mean if you don't have issues with that one, that's because you must use it like that. The Get Report working with any report is a time bomb. The doc specify: "Returns the specified report from My workspace.". Some day it will stop working for you. I would strongly suggest using get report in group.

The best way would be creating a Service Principal and add it to the workspace. That would work as a service account to manage all this without an specific AD user.

I'm currently working like that, and it retrieves the EmbedURL without doing anything else. I can get it from get reports in group (all of the reports with embed in the group) or get report in group (one by one)

I hope that helps,


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

Happy to help!

LaDataWeb Blog

View solution in original post

Hi. The security concern shouldn't be there. The Service Principal (service account) won't have access to everything. It only has access to the resources shared with the account. It will only see the workspaces in which the account has a role. The only way to make the Service Principal manipulate the admin API is with a special concent from the tenant settings that I assume you won't have because it can only be applied to a security group.

The 403 can also be due to permissions. Be sure the registered app has Report.ReadWrite.All or Report.Read.All

I hope that helps,


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

Happy to help!

LaDataWeb Blog

View solution in original post

6 REPLIES 6
ibarrau
Super User
Super User

Hi. No I don't. If the accout logged in with the API is inside the Workspace, the account should reach the report. One thing that might be strugling here is the request. 404 is a wrong request. That's not the request you should use to get a report from a workspace. The API has specific requests for content in a workspace ending with "in group". Make the call with the get report in group if you want to get reports from a workspace.

https://docs.microsoft.com/en-us/rest/api/power-bi/reports/get-report-in-group

I hope that helps,

P/D if you get 403 these are the permissions for the registered app "Report.ReadWrite.All or Report.Read.All".


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

Happy to help!

LaDataWeb Blog

Hi @ibarrau ,

 

Actually, I'm not in the workspace, so when I tried to get the report using Workspace ID and Report ID, I encountered 403 error as you mentioned, that's true. The fact is I'm able to use this API https://docs.microsoft.com/en-us/rest/api/power-bi/reports/get-report to get the report using Report ID only, even I'm now not in the workpsace, I wasn't able to do when I didn't access the report using the shared link for the first time.

 

As of now, whenver I open the report via the shared link https://app.powerbi.com/groups/ae53f177-de65-4dd3-9ccd-xxxxxx/reports/c0803633-5b6e-44de-b05e-xxxxxx... it redirects me to a new link https://app.powerbi.com/groups/me/reports/c0803633-5b6e-44de-b05e-xxxxxxxx/ReportSection3974bd03db63... the group changes from GUID to me, which I guess I've been added to a workspace called me, so that's why I can use the API to get the result with Report ID only.

 

The requirement is to get the embed url and the load them inside our web page without asking the user opens the shared link on https://app.powerbi.com/ and  I would like to understand why it happens in order to think of another solution if it's not doable (I can't find any explanation or documentation for this).

 

Thanks,

Nam.

Hi. I understand. However, have you tried the get reports in group? I mean if you don't have issues with that one, that's because you must use it like that. The Get Report working with any report is a time bomb. The doc specify: "Returns the specified report from My workspace.". Some day it will stop working for you. I would strongly suggest using get report in group.

The best way would be creating a Service Principal and add it to the workspace. That would work as a service account to manage all this without an specific AD user.

I'm currently working like that, and it retrieves the EmbedURL without doing anything else. I can get it from get reports in group (all of the reports with embed in the group) or get report in group (one by one)

I hope that helps,


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

Happy to help!

LaDataWeb Blog

Hello again, I've tried that and it returned 403 since I have been added to the workspace. I was trying to use a service account in order to get the report in the workspace, however, there was a security concern that the service was able to access all the reports, datasets, dashboards in the workspace. From your experience, are there any solutions to limit the service account to access certain reports it is assigned to?

Hi. The security concern shouldn't be there. The Service Principal (service account) won't have access to everything. It only has access to the resources shared with the account. It will only see the workspaces in which the account has a role. The only way to make the Service Principal manipulate the admin API is with a special concent from the tenant settings that I assume you won't have because it can only be applied to a security group.

The 403 can also be due to permissions. Be sure the registered app has Report.ReadWrite.All or Report.Read.All

I hope that helps,


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

Happy to help!

LaDataWeb Blog

Thanks for this @ibarrau 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.