Power BI is a Business Intelligence (BI) tool offered by Microsoft that provides you with real-time high-level analytics, extensive modeling, and custom development. It has led the charge in making business analysis more efficient through services that are intuitive, interactive, and easy to use.

REST API is defined as a Software Architectural Style built to guide the development and design of the architecture for the World Wide Web. REST APIs define a set of constraints for how the architecture of a distributed system should behave. 

This blog talks about the different methods you can use to establish REST API Power BI Integration. It also gives a brief introduction to the concept of REST API & Power BI and the benefits of Power BI API connection.

What is Power BI REST API?

The Power BI REST API is a web service from Microsoft that allows you to interact with the Power BI service programmatically. Think of the REST API as a bridge for controlling and customizing Power BI from your applications, scripts, and workflows. You use it to push data into Power BI, manage your reports and dashboards, and embed them in your apps.

Integrate REST API to BigQuery
Integrate Salesforce to Snowflake
Integrate Webhooks to Redshift

Method 1: Using Power BI Inbuilt Web Connector for REST API Power BI Integration

Prerequisites:

I will use the Star Wars API for this example, but you can use any other REST API. Not only JSON but Power BI also supports HTML.

  • Go to SWAPI and type the following API to receive the JSON Data.
  • Type /people in the URL, and you will be able to see your JSON Data.
Star Wars API

Step 1: Setting Up Power BI Environment

Step 1. a) Open your Power BI Desktop

Step 1. b) Select Get Data From Other Sources

Power BI Desktop

Step 1. c) Now Click on Other and search for Web. Finally, click Connect.

Get Data from Web as a Source

Step 1. d) After clicking on connect, we will configure the URL. Once you have configured the URL according to your requirements, you can proceed by clicking on OK.

Note: If you have some service that might take longer, you can add a Timeout.

Note: If you have a service that requires you to pass an authorization header or some other header, you can add a header.

With this, you have imported your data from rest API to power BI.

Step 2: Previewing your Data

Table Preview

Method 2: Using Power BI Developer Portal for REST API Power BI Integration

Step 1: Registering an Application for Power BI

Step 1. a) Choose an Embedding Solution

Choose an embedding solution if you want it for a customer or want to build it for an organization.

For this demonstration, I will choose Embed for Your Customer.

Choose an Embedding Solution

Step 1. b) Register an Application for Power BI

Sign In to your Power BI Account.

Sign In Page

Step 1. c) Register your application and select API access. For this demonstration, I will choose all the options.

Step 1. d) Creating a new Workspace. This step is optional here. I want to create a new Workspace so that I can proceed with this step, but you can skip it.

Step 1. e) The Import content is also optional for this exercise. I will proceed with a sample Power BI report.

Import Content Tab

Note: Granting Permissions is the most crucial step. Sign in to your Microsoft account and grant all the required permissions.

Step 2: Configuring Microsoft Azure

Step 2. a) Go to your Microsoft Azure directory and search for APP Registrations

Step 2. b) Click on All Applications. Here, you will see the new app that you just created.

Note: Go into the app, go to authentication, and under the Implicit grants and hybrid flows, make sure that you check the access token

Authentication Tab

Step 3: Generate Access Token

Step 3. a) To generate the access token, use your code studio, give your app_id and tenant_id, and use the code given below to generate a new token:

Client = msal.PublicClientAppliaction(app_id, authority=authority_url)

Response = client.acquire_token_by_username_password(username=username, password=password, scopes=scopes)

Access_id = response.get(‘access_token’)

Step 3. b) We will write simple API code for the Power API service. This will give us the workspaces currently in my Power BI account.

Endpoint = ‘’

Headers = {

‘Authorization’:

}

Response_request = requests.get(endpoint, headers=headers)

Note:

  • We will add our endpoint url
  • In the headers, we need to add the access token 
  • If the response is 200, it means that our API call is working; we can print the items of the API call.

With these steps, you will have completed REST API Power BI Integration, and you will be able to see all the workspaces in your terminal window:

Result for Queries

Method 3: Using Hevo for Automated REST API Power BI Integration

Step 1: Configure the REST API as a Source

REST API Source

Step 2: Configure BigQuery as a Destination

BigQuery Destination Configuration

Step 3: Configure Power BI to Move Data

Get Data Power BI

Step 3. a) On the Get Data page, select Database in the left pane. From the list displayed, select Google BigQuery, then select Connect.

Select Google BigQuery

Step 3. b) Select Sign in to connect to your managed BigQuery.

BigQuery Sign in

Step 3. c) Use your Google account to Log In.

Step 3. d) On the next page, select Allow to enable Power BI to access your data in managed BigQuery.

Give Access to Power BI

Note: Specify your Project ID and Dataset ID in the connection settings.

Step 3. e) Choose Import as the Data Connectivity mode under connection settings.

Connection Settings

Step 3. f) You can see the tables in your dataset in the Navigator. Choose the tables you need and load them.

Final Result

As can be seen, you are simply required to enter the corresponding credentials to implement this Fully Automated Data Pipeline for REST API Power BI Integration without using any code.

What Type of Operations can we do with Power BI REST API?

Power BI REST API exposes a rich set of operations that you can use to manage and enhance your Power BI experience. The following are the critical operations that you would possibly do with this powerful tool:

1. Dataset Management

  • Creating Datasets
  • Update datasets

2. Report operations 

  • Get reports
  • Export Reports

3. Dashboard Management

  • Get Dashboards
  • Create Dashboards

4. Tile Operations

  • Get Tiles
  • Update Tiles

5. Embedding and Integration

  • Generate Embed Tokens
  • Embed Content

6. Workspace Management

  • Establish New Workspaces
  • List Workspaces

7. User and Group Management

  • Add Users to Workspaces
  • Remove Users from Workspaces

8. Dataflow Operations

  • Create Dataflows
  • Get Dataflows

What are the Benefits of REST API Power BI Integration?

The REST API allows us to construct custom apps that deliver data into a Power BI dashboard using programmatic access to dashboard components such as Datasets, Tables, and Rows.

The REST API currently has the following operations:

  • Dataset operations include obtaining and creating data sets.
  • Table operations include obtaining tables and updating the table schema.
  • Row operations include adding and deleting rows.
  • Group operations include obtaining Groups.
  • Import operations include creating Imports, getting Imports, getting Imports from GUID, and getting Imports by File Path.
  • Dashboard operations include obtaining dashboards and tiles.

Learn more about the differences between REST API and API.

Using the Power BI REST APIs

The Power BI REST APIs provide service endpoints for embedding, administration, governance, and user resources.

With Power BI REST APIs, you can do the following:

  • Organize your Power BI content
  • Execute administrative operations
  • Content from Power BI can be embedded

Conclusion

This blog discusses Power BI Rest API Examples and the different methods to establish a Power BI Web API Connection: using the Power BI Developer Portal and a No-code Data Pipeline, Hevo Data. It also briefly introduces Power BI and REST API before delving into the methods used for REST API Power BI Integration.

FAQ

  1. What is REST API in Power BI?

The Power BI REST API provides programmatic access to Power BI services, thus making it possible to automate tasks, manage reports and datasets, dashboards, and embed Power BI capabilities into your applications. Put simply, this is how you manage Power BI right from your code.

  1. How do I add data from REST API to Power BI?

To import data from a REST API into Power BI, use the Power Query Editor. 

  • Get Data: Open Power BI Desktop and click on “Get Data” > “Web.”.
  • URL: Enter your REST API endpoint URL.
  • Data Transformation: Use Power Query Editor to clean and transform your data in any way you require.
  • Data Loading: Load Data into Power BI.
  1. Can Power BI make API calls?

Power BI can make API calls using Power Query (M language). This lets you fetch data from APIs and bring it into Power BI for analysis and visualization.

  1. How do you authenticate the rest of the API in Power BI?

Authentication depends on the API. Here are the standard methods:

  1. Basic Authentication: In this Method, you include your Username and Password in the API Call.
  2. API Key: Here, you include the API Key in the Header.
  3. OAuth2: Obtain an access token using a script or tool. Use the token in your Power BI Query.

Give Hevo a try and Sign Up up for a 14-day free trial today!You can also have a look at the unbeatable Hevo Pricing that will help you choose the right plan for your business needs. 

You can now transfer data from sources like REST API to your target destination like Power BI for Free using Hevo!

mm
Content Marketing Manager, Hevo Data

Amit is a Content Marketing Manager at Hevo Data. He is passionate about writing for SaaS products and modern data platforms. His portfolio of more than 200 articles shows his extraordinary talent for crafting engaging content that clearly conveys the advantages and complexity of cutting-edge data technologies. Amit’s extensive knowledge of the SaaS market and modern data solutions enables him to write insightful and informative pieces that engage and educate audiences, making him a thought leader in the sector.

No-code Data Pipeline for Power BI