我通过邮递员获取访问令牌,如下图所示
除非范围错误(我认为不是),否则我应该能够访问报告和 Power BI 组,只需将生成的令牌作为请求中的标头传递即可通过令牌后,我得到 403 我不确定我的请求有什么问题,尽管我知道 403 意味着缺少某些权利.有什么建议么 ?谢谢
现在我明白了这就是我认为的问题,但我不确定,ConsentType :AllPrinciapls
解决方案不记名令牌需要访问令牌,而不是客户端机密.您需要为 Power BI Embedded 案例注册本机应用而不是服务器端 Web 应用并授予足够的权限.
这样就可以调用GenerateToken API.
您终于可以调用报告了.示例在此处
参考问题及其答案:community.powerbi/t5/Developer/Power-BI-REST-API-using-postman-generate-embed-token/td-p/310054
I am getting an access token through post man as shown from image below
Unless the scope is wrong which i think is not i should be able to access reports and groups of power BI, just by passing the generated token as header in the request After passing the token i get 403 I am not sure what is wrong with my request although i do know 403 means some rights are missing. Any suggestions ? Thank you
Now i am getting this This is what i think might be the issue but i am not sure, ConsentType :AllPrinciapls
解决方案The bearer token requires an access token, not the client secret. You need register a Native app rather than a server-side web app for Power BI Embedded cases and grant sufficient permissions.
Register App
Granting Permission
Then to get the access token, you can call the POST API in POSTMAN as
POST /common/oauth2/token HTTP/1.1 Host: login.windows Cache-Control: no-cache Content-Type: application/x-www-form-urlencoded client_id={client id}&grant_type=password&resource=https%3A%2F%2Fanalysis.windows%2Fpowerbi%2Fapi&username={your power bi account}&password={your Power BI password}So that you can call you can call the GenerateToken API.
At last you can call Reports. Example is given here
Ref Question and it's answer: community.powerbi/t5/Developer/Power-BI-REST-API-using-postman-generate-embed-token/td-p/310054
更多推荐
通过 Postman 访问 Power bi 的组和报告
发布评论