.NET Framework/Embed for your organization/UserOwnsData/Controllers/EmbedInfoController.cs
/// <summary>
/// Returns Embed config of dashboard to the client
/// </summary>
/// <param name="workspaceId">Workspace where the dashboard resides</param>
/// <param name="dashboardId">Dashboard to be embedded</param>
/// <returns>JSON containing access token and embed url for embedding dashboard</returns>
Returns Embed config of dashboard to the client
Returns Embed config of dashboard to the client
[Authorize]
		[HttpPost]
		[Route("/embedinfo/dashboardembedconfig")]
		public async Task<JsonResult> DashboardEmbedConfig(string workspaceId, string dashboardId)
		{
			try
			{
				if (string.IsNullOrWhiteSpace(workspaceId))
				{
					throw new ArgumentNullException(nameof(workspaceId));
				}
				else if (string.IsNullOrWhiteSpace(dashboardId))
				{
					throw new ArgumentNullException(nameof(dashboardId));
				}
				else
				{
					return this.Json(await PowerBIService.GetDashboardEmbedConfigAsync(workspaceId, dashboardId));
				}
			}
			catch (HttpRequestException ex)
			{
				Console.Error.WriteLine(ex);
				throw;
			}
			catch (FormatException ex)
			{
				Console.Error.WriteLine(ex);
				throw;
			}
		}
[ Authorize ] [ HttpPost ] [ Route ( " " ) ] public async Task < JsonResult > DashboardEmbedConfig ( string workspaceId , string dashboardId ) { try { if ( string . IsNullOrWhiteSpace ( workspaceId ) ) { throw new ArgumentNullException ( nameof ( workspaceId ) ) ; } else if ( string . IsNullOrWhiteSpace ( dashboardId ) ) { throw new ArgumentNullException ( nameof ( dashboardId ) ) ; } else { return this . Json ( await PowerBIService . GetDashboardEmbedConfigAsync ( workspaceId , dashboardId ) ) ; } } catch ( HttpRequestException ex ) { Console . Error . WriteLine ( ex ) ; throw ; } catch ( FormatException ex ) { Console . Error . WriteLine ( ex ) ; throw ; } }
Returns Embed config of dashboard to the client
Returns Embed config of dashboard to the client
// Generates embedConfig for dashboard
JSON containing access token and embed url for embedding dashboard
JSON containing access token and embed url for embedding dashboard
workspaceId
string
Workspace where the dashboard resides
Workspace where the dashboard resides
dashboardId
string
Dashboard to be embedded
Dashboard to be embedded