Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello - I am working with Power BI Embedded and successfully got a working embedded report running locally using an access token generated using POWERSHELL
and have successfully sent this GET request to the power BI API
https://api.powerbi.com/v1.0/myorg/groups/{my group ID}/reports/- so I think authentication is ok -
However when I try to do a POST request to test generating a token (I want to test refreshing the access token before using API in JS) using
Hello - i'v the exact same issue.
If I go to the admin panel, select Workspaces, I get following message:
Workspaces V2 bulk upgrade is now available. Select "Upgrade all" below to experience the benefits of the latest version.
However, there is nothing to click, upgrade!?
I expect i do have already v2 workspaces but i got teh same error:
{
"error": {
"code": "InvalidRequest",
"message": "Api isn't supported for workspace V1"
}
}
Hi @rkq81
@Jayendranis correct in that the endpoint you are using is restricted to V2 workspaces.
If you aren't ready to upgrade to V2 just yet (but you will need to soon) - you can use the alternative api endpoint for generating an access token for individual reports.
https://docs.microsoft.com/en-us/rest/api/power-bi/embedtoken/reports_generatetokeningroup
This endpoint will require a single report-id and workspace-id (group), but it will work with V1 and V2 workspaces.
If you only want an access token for a single report, then this is the endpoint to use.
Thanks for your reply. When I try that endpoint I get a '403 Forbidden' reponse
HI @rkq81
Even if you are an admin of the Power BI Tenant you will need to double check the account permissions which you are using to access the API.
How are you generating the access token? username & password or Service Principal account?
I have checked the GenerateToken endpoint this morning with my own accounts and this works as expected, so it makes me think that the original error message might be misleading if you are already in a V2 workspace.
It's worth going back and checking the permissions set on the account you are using for API access.
This is the thing that has often caught me out in the past.
There are a number of required scopes for your original endpoint
https://docs.microsoft.com/en-us/rest/api/power-bi/embedtoken/generatetoken
403 errors will often be scope related if the credentials/tokens you are using can use other parts of the API.
Hi @rkq81 ,
Please see the restriction of the GenerateToken API as per that this will work only in V2 workspace.
There are 2 types of workspaces in PowerBI
Currently you are using V1 workspace which is not supported for this API. So please upgrade your workspace to V2 , please refer the below link on how to upgrade to V2 from V1 workspace
https://docs.microsoft.com/en-us/power-bi/designer/service-upgrade-workspaces
Hi @Jayendran
Thanks for your response - when I go to upgrade my workspaces I don't have the same menu as the tutorial to upgrade (please see screenshot) any idea what permissions I might be missing? Clearly I don't have all the authorization I need but I am an admin in power BI -
Any advice? Thanks for your help so far
Hi @rkq81 ,
From the screenshot it seems you already in V2 workspace. Because only in the V2 workspace you get the options called Workspace Settings/Workspace access
In V1 workspace you will see the Edit this workspace
So... Hmm how come I'm still getting that response 403 forbidden from the API -
User | Count |
---|---|
15 | |
2 | |
1 | |
1 | |
1 |
User | Count |
---|---|
18 | |
11 | |
5 | |
4 | |
3 |