Skip to content

Instantly share code, notes, and snippets.

@ahelland
Created January 23, 2018 15:34
Show Gist options
  • Save ahelland/620d4577a18562029797d9c7293c6de9 to your computer and use it in GitHub Desktop.
Save ahelland/620d4577a18562029797d9c7293c6de9 to your computer and use it in GitHub Desktop.
var tokenCredentials = new TokenCredentials(token.access_token, "Bearer");
// Create a Power BI Client object. It will be used to call Power BI APIs.
using (var client = new PowerBIClient(new Uri(ApiUrl), tokenCredentials))
{
// Generate Embed Token.
var generateTokenRequestParameters = new GenerateTokenRequest(accessLevel: "view");
var tokenResponse = await client.Dashboards.GenerateTokenInGroupAsync(GroupId, dashboardId,
generateTokenRequestParameters);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment