问题
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
回答1:
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.net
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
client_id={client id}&grant_type=password&resource=https%3A%2F%2Fanalysis.windows.net%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: https://community.powerbi.com/t5/Developer/Power-BI-REST-API-using-postman-generate-embed-token/td-p/310054
来源:https://stackoverflow.com/questions/57753927/access-groups-and-reports-of-power-bi-through-postman