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