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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

getting 403 forbidden for



I got the dashboard using REST API [] and try to visualize dashboard data as a graph by embedUrl but not able to get graph using embedURl

so please can you help me out to get graph using embedURL.

I also try this below code


<script src=""></script>
<script src=""></s...>
<script type="text/javascript">
// Read embed application token from Model
var accessToken = "replace with my accesstoken";

// Read embed URL from Model
var embedUrl = "";

// Read dashboard Id from Model
var embedDashboardId = "a0092f2c-bb95-4565-b5f9-f8523a218b90";

// Get models. models contains enums that can be used.
var models = window['powerbi-client'].models;

// Embed configuration used to describe the what and how to embed.
// This object is used when calling powerbi.embed.
// This also includes settings and options such as filters.
// You can find more information at
var config = {
type: 'dashboard',
tokenType: models.TokenType.Embed,
accessToken: accessToken,
embedUrl: embedUrl,
id: embedDashboardId

// Get a reference to the embedded dashboard HTML element
var dashboardContainer = $('#dashboardContainer');

// Embed the dashboard and display it within the div container.
var dashboard = powerbi.embed(dashboardContainer.get(0), config);
<div id="dashboardContainer" powerbi-settings-nav-content-pane-enabled="true" powerbi-settings-filter-pane-enabled="true"></div>


I also try to get dashboard visualization on online but

getting 403 forbidden



Microsoft Employee
Microsoft Employee

Hi @dharamgoyal,


Usually, you get a 403 when the application does not have appropriate permissions. Remember that if you added permissions (scopes) to the application AFTER the user trusted the application, the user’s token won’t get the new scopes until they remove trust from the application and trust it again. Easiest workaround is to create a new application and use that instead.  Alternative is to manually remove the application using Office 365’s “my apps” feature and then try to use the application again.


Here is an article shows the code used in the integrate-dashboard-web-app on GitHub. Could you try downloading the sample and follow steps there from beginning to see if the code works for you? Smiley Happy


You might also draw inspiration from several other similar threads from other services:



Hi @v-ljerr-msft

Thanks for your response, i have added the permission

"scope": "Content.Create Dashboard.Read.All Dashboard.ReadWrite.All Data.Alter_Any Dataset.Read.All Dataset.ReadWrite.All Group.Read Group.Read.All Metadata.View_Any Report.Read.All Report.ReadWrite.All Tenant.Read.All Workspace.Read.All Workspace.ReadWrite.All",

still getting same error and i am not aware with c# or .Net, i am a PHP developer.

So there is any example in PHP?


this is embed url id did get using api so how can display graph by this embed url

Hi @dharamgoyal,


Following are two articles/samples about how to integrate a Power BI report into your own PHP web app. Could you go to check if it helps in your scenario? Smiley Happy



Hi @v-ljerr-msft,


I tried first one but getting 403 forbidden error below is my code.


$key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // Fill in the Azure Power BI Workspace Collection Access Key
    $payload = array(
    "ver" => "0.2.0",
    "type" => "embed",
    "wcn" => "LsquaredHubWorkspace", // Fill in the Azure Power BI Workspace  Collection Name
    "wid" => "lsquaredhubworkspace", // Fill in the Workspace ID
    "rid" => "xxxxxxxxxxxxxxxxxxxxxxxxxxx", // Fill in the Report IDxx
    "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>  <!-- JQuery is used to link to report to the div element-->
        <script src=""></s...> <!-- JavaScript library for embedding Power BI -->       
        <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 embedConfiguration= {
        type: 'report',
        accessToken: setAccessToken,
        embedUrl: setEmbedUrl,
        id: setEmbedReportId,
        /*settings: {
        filterPaneEnabled: false,
        navContentPaneEnabled: false
        var jQueryreportContainer = jQuery('#reportContainer');
        var report = powerbi.embed(jQueryreportContainer.get(0), embedConfiguration);

I debug my code everything is fine in that but rather than getting error.


This content isn't available. 403 (Forbidden)


I think currently i am using trial/Pay-As-You-Go plan, please let me know what i am missing or doing wrong.

Helpful resources

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

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