Jump to content

How to use Power BI API to generate Power BI workspace content


Recommended Posts

Guest Amber-Data
Posted

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

 

  • An active Azure subscription. If you don't have one, create a free Azure account before you begin.
  • Download Postman or use Postman online free version.
  • Generate Access Token with Power BI Administrator permission. This article help you understand what Power BI Administrator role is, and how to assign a user to Power BI Administrator role. This article will help you better understand Power BI Administrator role.

 

 

 

Steps

 

1. Download Postman and import Postman 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.

 

mediumvv2px400.png.99728ab691ae58d13e36f994ea6a7e92.png

 

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
to get Power BI location. And replace your location to the following Location parameter.

 

>

 

Please make sure the status is "Succeeded". If not, please wait for some time and resend the Get request.

 

mediumvv2px400.png.cc90ea7ceab44ca40761e99f8b65edbb.png

 

 

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.

 

mediumvv2px400.png.746daa738a93dcfbe3e291c50b1b09c6.png

 

Continue reading...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...