Forum Discussion

jstearnes's avatar
jstearnes
Advocate I
8 years ago

Calling embedUrl in browser hangs

I have retrieved a list of reports from the REST API - https://msdn.microsoft.com/en-us/library/mt634543.aspx and I have tried using the embedUrl in my broswer but it just hangs, there are no network or console errors in Chrome dev tools. I am using Chrome Version 63.0.3239.132 (Official Build) (64-bit). Can anyone help?

4 Replies

  • v-ljerr-msft's avatar
    v-ljerr-msft
    Microsoft Employee

    Hi jstearnes,

     

    The embedUrl cannot be directly used in browser. You'll need to do some coding(js, C#, and so on) to consume the embedUrl for embedding. The sample code below is written with PowerBI-JavaScript api. You can refer this article for more details. :smileyhappy:

    // Get models. models contains enums that can be used.
    var models = window['powerbi-client'].models;
    
    var embedConfiguration = {
    	type: 'report',
    	id: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',
    	embedUrl: 'https://app.powerbi.com/reportEmbed',
    	tokenType: models.TokenType.Embed,
    	accessToken: 'h4...rf'
    };
    
    var $reportContainer = $('#reportContainer');
    var report = powerbi.embed($reportContainer.get(0), embedConfiguration);

     

    Regards

    • jstearnes's avatar
      jstearnes
      Advocate I

      Hi v-ljerr-msft I am building a REST API using Java so I'm not using JavaScript. I need to return a URL to our client application that allows them to view the report without having to perform any additional steps

    • jstearnes's avatar
      jstearnes
      Advocate I

      Also, using the embedUrl on it's own should result in some sort of error, not in the browser hanging with no feedback