Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi,
I got the dashboard using REST API [https://api.powerbi.com/v1.0/myorg/groups/dc7cedf0-bc50-4e38-af1a-56f6704c0ffc/dashboards] 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="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/jquery/dist/jquery.js"></script>
<script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/powerbi-client/dist/powerbi.js"></s...>
<script type="text/javascript">
// Read embed application token from Model
var accessToken = "replace with my accesstoken";
// Read embed URL from Model
var embedUrl = "https://app.powerbi.com/dashboardEmbed?dashboardId=a0092f2c-bb95-4565-b5f9-f8523a218b90&groupId=dc7c...";
// 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 https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details.
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);
alert(dashboard);
</script>
<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 https://microsoft.github.io/PowerBI-JavaScript/demo/v2-demo/index.html but
getting 403 forbidden https://wabi-india-west-redirect.analysis.windows.net/metadata/cluster
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?
You might also draw inspiration from several other similar threads from other services:
http://stackoverflow.com/questions/31735264/403-forbidden-from-azure-graph-api
https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-developers-guide
Regards
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 https://app.powerbi.com/embed?dashboardId=a0092f2c-bb95-4565-b5f9-f8523a218b90&tileId=24985201-f2b8-... 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?
https://github.com/retk/powerbi-php-sample
Regards
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" => "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> <!-- JQuery is used to link to report to the div element-->
<script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/powerbi-client/dist/powerbi.js"></s...> <!-- JavaScript library for embedding Power BI -->
<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 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);
</script>
I debug my code everything is fine in that but rather than getting error.
Error:
This content isn't available.
https://wabi-india-west-redirect.analysis.windows.net/metadata/cluster 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.
User | Count |
---|---|
24 | |
21 | |
11 | |
11 | |
10 |
User | Count |
---|---|
49 | |
31 | |
20 | |
18 | |
15 |