Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
When I try to get report using end point provided in documentation. I get Error 403 "Access to api.powerbi.com was denied".
The Url I am using to access report is
https://api.powerbi.com/v1.0/myorg/reports/[MY_REPORT_ID]
I tried sending access_token in GET and POST but same result. I am getting access_token and refresh_token using the Authorization Code. "Read and Write datasets" permissions are set.
What is the issue? I think /myorg/ in above Url is static and I don't need to replace it with my organization name? I even tried but got same error.
Please Help!
Solved! Go to Solution.
Hi @Gulfam ,
Do you want to connect to Power BI REST API in Power BI Desktop and you will get 403 errror?
Firstly, we need to get Access token in Power BI Desktop. We will get access token from Power BI by below code.
Please replace the parameters like "client_id","APP ID" and so on by correct values.
() =>
let
body = "client_id=" & #"App ID"
& "&scope=https://analysis.windows.net/powerbi/api/.default&client_secret=" & #"App Secret"
& "&grant_type=client_credentials",
Data= Json.Document(Web.Contents("https://login.microsoftonline.com/"& TenantID & "/oauth2/v2.0/token/",
[Headers=[#"Content-Type"="application/x-www-form-urlencoded"], Content=Text.ToBinary(body)])),
access_token = Data[access_token]
in
access_token
OR
() =>
let
body = "&grant_type=Password&resource = https://analysis.windows.net/powerbi/api
&client_id=*****&username=*****&password=*****",
Data=Json.Document(Web.Contents("https://login.microsoftonline.com/common/oauth2/v2.0/token/",
[Headers=[#"Content-Type"="application/x-www-form-urlencoded"], Content=Text.ToBinary(body)])),
access_token = Data[access_token]
in
access_token
Then you can follow this video to get data from the Rest API by access token in first step.
Finally, you can replace bear token by the access token parameter.
It will refresh every time your refresh your report.
Video: How to get access token and call Rest API by dynamic access token in Power BI Desktop? (5:30 to 9:30)
all Power BI Rest API with Dynamic Access Token From Power BI Desktop |Power BI Rest API
For more details, you may refer to this offical blog to learn more details about Get Report Rest API.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Gulfam ,
Do you want to connect to Power BI REST API in Power BI Desktop and you will get 403 errror?
Firstly, we need to get Access token in Power BI Desktop. We will get access token from Power BI by below code.
Please replace the parameters like "client_id","APP ID" and so on by correct values.
() =>
let
body = "client_id=" & #"App ID"
& "&scope=https://analysis.windows.net/powerbi/api/.default&client_secret=" & #"App Secret"
& "&grant_type=client_credentials",
Data= Json.Document(Web.Contents("https://login.microsoftonline.com/"& TenantID & "/oauth2/v2.0/token/",
[Headers=[#"Content-Type"="application/x-www-form-urlencoded"], Content=Text.ToBinary(body)])),
access_token = Data[access_token]
in
access_token
OR
() =>
let
body = "&grant_type=Password&resource = https://analysis.windows.net/powerbi/api
&client_id=*****&username=*****&password=*****",
Data=Json.Document(Web.Contents("https://login.microsoftonline.com/common/oauth2/v2.0/token/",
[Headers=[#"Content-Type"="application/x-www-form-urlencoded"], Content=Text.ToBinary(body)])),
access_token = Data[access_token]
in
access_token
Then you can follow this video to get data from the Rest API by access token in first step.
Finally, you can replace bear token by the access token parameter.
It will refresh every time your refresh your report.
Video: How to get access token and call Rest API by dynamic access token in Power BI Desktop? (5:30 to 9:30)
all Power BI Rest API with Dynamic Access Token From Power BI Desktop |Power BI Rest API
For more details, you may refer to this offical blog to learn more details about Get Report Rest API.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
11 | |
4 | |
4 | |
3 | |
3 |