none
Not able to integrate Power BI google analytic service dashboard embed url in my application using REST API RRS feed

  • Question

  • Hi,

    Currently subscription plan is "Pay-As-You-Go"

    I am trying to embed Power BI dashboard, reports and tiles into my application.

    I tried on Microsoft Power BI Embedded Sampleonline https://microsoft.github.io/PowerBI-JavaScript/demo/v2-demo/index.html# with token, dashboard/report id and embed url but getting below errors-
    {
      "message": "LoadReportFailed",
      "detailedMessage": "GetReportFailed",
      "technicalDetails": {
        "requestId": "cfe120f7-346f-3eb1-03ef-9df2e30d3183"
      },
      "errorCode": "NotAuthorized"
    }

    You can also check my below code-
    $key = "xxxxxxxxxxxxxxxxxxxxxxxxxx"; // Fill in the Azure Power BI Workspace Collection Access Key

        $payload = array(
        "ver" => "0.2.0",
        "type" => "embed",
        "wcn" => "xxxxxxx", // Fill in the Azure Power BI Workspace  Collection Name
        "wid" => "xxxxxxx", // Fill in the Workspace ID
        "rid" => "xxxxxxxxxx", // Fill in the Report ID
        "iss" => "PowerBISDK",
        "aud" => "https://analysis.windows.net/powerbi/api",
        "scp" => "Report.Read",
        "exp" => time()+60*60, // The expiration time of the token, in this case 1 hour
        "nbf" => time()
        );
        require("JWT.php");
        $jwtObj = new JWT;
        $token = $jwtObj->encode($payload,$key); // the actual token    ?>
            <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
            <script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/powerbi-client/dist/powerbi.js"></script>        
            <div id="reportContainer" powerbi-settings-nav-content-pane-enabled="true"   powerbi-settings-filter-pane-enabled="true"></div>
            <script>
            var setAccessToken = '<?php echo $token;?>';
            var setEmbedUrl = "https://embedded.powerbi.com/appTokenReportEmbed?reportId=6a5564f2-bab1-4593-ae74-bebe9618b1ec";
            var setEmbedReportId = "6a5564f2-bab1-4593-ae74-bebe9618b1ec";
            var setEmbedDashboardId = "8e16da37-0311-4a6a-858d-f2ab23a89757";
            var embedConfiguration= {
            type: 'report',
            accessToken: setAccessToken,
            embedUrl: setEmbedUrl,
            id: setEmbedReportId,
            settings: {
            filterPaneEnabled: false,
            navContentPaneEnabled: false
            }
            };
            var $reportContainer = $('#reportContainer');
            var report = powerbi.embed($reportContainer.get(0), embedConfiguration);
            </script>
    Error: https://wabi-india-west-redirect.analysis.windows.net/metadata/cluster 403 (Forbidden)

    Please help me out to resolve this issue.
    Sorry for typo mistakes.


    Tuesday, December 12, 2017 7:09 AM

Answers