Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello -
I am able to generate token for dashboards that do not have any links embedded just fine, but with anything that has links I get the "InternalServer" error.
var token = new TokenCredentials(accessToken, "Bearer");
using (var client = new PowerBIClient(new Uri("https://api.powerbi.com"), token))
{
ODataResponseListDashboard dashboards = client.Dashboards.GetDashboardsInGroup(groupId);
GenerateTokenRequest request = new GenerateTokenRequest("view");
Dashboard dashboard = dashboards.Value.FirstOrDefault(a => a.DisplayName.Contains("Test"));
try
{
EmbedToken embedToken = client.Dashboards.GenerateTokenInGroup(groupId, dashboard.Id, request);
}
catch (Exception ex1)
{
}
}
Any help would be appreciated.
Thanks, Shilpi
@Anonymous wrote:
Hello -
I am able to generate token for dashboards that do not have any links embedded just fine, but with anything that has links I get the "InternalServer" error.
var token = new TokenCredentials(accessToken, "Bearer");
using (var client = new PowerBIClient(new Uri("https://api.powerbi.com"), token))
{
ODataResponseListDashboard dashboards = client.Dashboards.GetDashboardsInGroup(groupId);
GenerateTokenRequest request = new GenerateTokenRequest("view");
Dashboard dashboard = dashboards.Value.FirstOrDefault(a => a.DisplayName.Contains("Test"));
try
{
EmbedToken embedToken = client.Dashboards.GenerateTokenInGroup(groupId, dashboard.Id, request);
}
catch (Exception ex1)
{
}
}
Any help would be appreciated.
Thanks, Shilpi
@Anonymous
The code works in my test, I don't get any error when trying to generate embed token for a dashboard with tiles having link to a report in the current workspace.
For those specific dashboards that lead to the internal server errors in your case, instead of the C# code, can you try to test the REST API GenerateToken with some test tool, like POSTMAN.
Thanks @Eric_Zhang, I will try that.
Are there any spcial permissions needed for those reports/dashboards?
Thanks, Shilpi
Also when I see the picture that you have attached, I realized that when you added the link to your report, the report appeared in the screenshot, where as I see this on my dashboard..
And I cannot publish the report that I am adding to the dashboard to the web and get an embed code that way, because this report is not meant to be public.
Hello -
I am able to generate token for dashboards that do not have any links embedded just fine, but with anything that has links I get the "InternalServer" error.
var token = new TokenCredentials(accessToken, "Bearer");
using (var client = new PowerBIClient(new Uri("https://api.powerbi.com"), token))
{
ODataResponseListDashboard dashboards = client.Dashboards.GetDashboardsInGroup(groupId);
GenerateTokenRequest request = new GenerateTokenRequest("view");
Dashboard dashboard = dashboards.Value.FirstOrDefault(a => a.DisplayName.Contains("Test"));
try
{
EmbedToken embedToken = client.Dashboards.GenerateTokenInGroup(groupId, dashboard.Id, request);
}
catch (Exception ex1)
{
}
}
Any help would be appreciated.
Thanks, Shilpi
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
16 | |
2 | |
2 | |
1 | |
1 |
User | Count |
---|---|
21 | |
2 | |
2 | |
2 | |
2 |