This sample shows how to use Power BI API to generate Power BI content from specific Power BI workspace. We have uploaded the example API request in GitHub repository, you can download the API request examples and test it out in your environment.
Prerequisites
Steps
1. Download Postman and import Postman request examples: API request examples
2. Log into Power BI website with admin account, press F12 to open browser console, then enter the following command in the browser console, past the access token to your clipboard.
copy(powerBIAccessToken)
3. Paste your access token into postman collection in Authorization tab with “Bearer Token” Type.
4. In step 1, fill in the workspace ids in the body of post requests with JSON format, then save and send the request:
5. Then you will get response body like below, please note down the id as request id:
{
"id": "******myrequestid",
"createdDateTime": "2023-06-06T02:21:57.8482466Z",
"status": "NotStarted"
}
6. In step 2, use your request id to replace <myrequestid> in the GET API.
7. In step 2, use https://api.powerbi.com/v1.0/myorg/capacities to get Power BI location. And replace your location to the following Location parameter.
https://*****.analysis.windows.net/v1.0/myorg/admin/workspaces/scanStatus/<myrequestid>
Please make sure the status is "Succeeded". If not, please wait for some time and resend the Get request.
8. If you can get the "Succeeded" status in step 2, let’s move to step 3, after replaced location and request id, if the GET request in step 3 got 200 status respond, you will see the output of the Power BI content.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.