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