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 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" => "",
        "scp" => "Report.Read",
        "exp" => time()+60*60, // The expiration time of the token, in this case 1 hour
        "nbf" => time()
        $jwtObj = new JWT;
        $token = $jwtObj->encode($payload,$key); // the actual token    ?>
            <script src=""></script>
            <script src=""></script>        
            <div id="reportContainer" powerbi-settings-nav-content-pane-enabled="true"   powerbi-settings-filter-pane-enabled="true"></div>
            var setAccessToken = '<?php echo $token;?>';
            var setEmbedUrl = "";
            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);
    Error: 403 (Forbidden)

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

    Tuesday, December 12, 2017 7:09 AM