Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello Team,
I was looking into using the Power BI API in an effort to automate the distribution of a report we have. Is there any documentation on getting setup to use it? I’ve tried sending a few calls via Postman but receive a 403 forbidden as a response. Guessing I’m not authenticating or authorizing correctly? Can you help me out please? Thank you!
Solved! Go to Solution.
Hi, @Anonymous
First of all, you should set the API permissions correctly in Auzre AD and get the correct secret and client ID, which are necessary parameters to get the access token.
Power BI REST APIs for embedded analytics and automation - Power BI REST API | Microsoft Learn
In the following document, the necessary parameters for requesting an access token are described and the meaning of each parameter is explained:
Understand the OAuth 2.0 authorization code flow in Azure AD - Microsoft Entra | Microsoft Learn
The 403 forbidden error can be due to two reasons:
1. You have requested the wrong access token, you can use the following two authorization addresses to request a new access token.
Auth URL: https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize
Access Token URL: https://login.microsoftonline.com/organizations/oauth2/token
2. The access token is not set to the request header. The access token should not be in the params in Postman, it should be in the Headers
The correct access token request for Power BI API results as follows:
You can learn how to authorize the Power BI API in Azure AD through the following links:
You need to enable the API feature in the admin portal of Power BI Service, as shown in the following figure:
The following article is a more detailed tutorial on using the REST API:
Power BI REST API: Step-by-step Guide to Use It | Coupler.io Blog
If the above advice can help you, that's great.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous
First of all, you should set the API permissions correctly in Auzre AD and get the correct secret and client ID, which are necessary parameters to get the access token.
Power BI REST APIs for embedded analytics and automation - Power BI REST API | Microsoft Learn
In the following document, the necessary parameters for requesting an access token are described and the meaning of each parameter is explained:
Understand the OAuth 2.0 authorization code flow in Azure AD - Microsoft Entra | Microsoft Learn
The 403 forbidden error can be due to two reasons:
1. You have requested the wrong access token, you can use the following two authorization addresses to request a new access token.
Auth URL: https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize
Access Token URL: https://login.microsoftonline.com/organizations/oauth2/token
2. The access token is not set to the request header. The access token should not be in the params in Postman, it should be in the Headers
The correct access token request for Power BI API results as follows:
You can learn how to authorize the Power BI API in Azure AD through the following links:
You need to enable the API feature in the admin portal of Power BI Service, as shown in the following figure:
The following article is a more detailed tutorial on using the REST API:
Power BI REST API: Step-by-step Guide to Use It | Coupler.io Blog
If the above advice can help you, that's great.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Please be more specific. Do you want to distribute the pbix, do you want to extract data, do you want to render the report into PPT or PDF, or do you want to manage subscriptions?
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 11 | |
| 11 | |
| 9 | |
| 8 | |
| 8 |