在Azure门户中,我注册了一个“本地”类型的应用程序。在Java中,我可以使用此API调用获取访问令牌
请求参数
client_id:天蓝色门户上的appId
grant_type:“密码”,这是硬编码
用户名:电子邮件
密码:电子邮件的密码
这给了我一个accessToken和refreshToken。我可以使用此accessToken调用任何Power BI API。例如获取所有报告,克隆报告,创建数据集等。
现在我想将报告嵌入到我的网页中,并通过jquery使用此API
function embedPBIReport(txtAccessToken, embedUrl, embedReportId, mode) {
// Read embed URL from textbox
var txtEmbedUrl = embedUrl;
// Read report Id from textbox
var txtEmbedReportId = embedReportId;
// Get models. models contains enums that can be used.
var models = window['powerbi-client'].models;
// We give All permissions to demonstrate switching between View and Edit mode and saving report.
var permissions = mode == 1 ? models.Permissions.Read : models.Permis