Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Gulfam
New Member

Error 403: Access to api.powerbi.com was denied

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!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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. 

RicoZhou_1-1654153987036.png

 

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.

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

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. 

RicoZhou_1-1654153987036.png

 

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.

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors