Forum Discussion
getting 403 forbidden for https://wabi-india-west-redirect.analysis.windows.net/metadata/cluster
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"></script>
<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=dc7cedf0-bc50-4e38-af1a-56f6704c0ffc";
// 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
4 Replies
- v-ljerr-msftMicrosoft 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? :smileyhappy:
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
- dharamgoyalFrequent Visitor
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 https://app.powerbi.com/embed?dashboardId=a0092f2c-bb95-4565-b5f9-f8523a218b90&tileId=24985201-f2b8-48fa-bc8c-37664173ed66&groupId=dc7cedf0-bc50-4e38-af1a-56f6704c0ffc id did get using api so how can display graph by this embed url
- v-ljerr-msftMicrosoft Employee
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? :smileyhappy:
https://github.com/retk/powerbi-php-sample
Regards