Forum Discussion

Mattdjuk's avatar
Mattdjuk
New Member
3 years ago

403 on Api call

Hi

 

I keep getting the following when I call the https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/tables

 

 

 

Error obtaining tables: StatusCode: 403, ReasonPhrase: 'Forbidden', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
{
  Strict-Transport-Security: max-age=31536000; includeSubDomains
  X-Frame-Options: DENY
  X-Content-Type-Options: nosniff
  Access-Control-Expose-Headers: RequestId
  RequestId: ed07e6ec-e517-42c6-b6a6-03d55e1ccc15
  Date: Mon, 17 Apr 2023 13:51:28 GMT
  Content-Length: 51
  Content-Type: application/json; charset=utf-8
}

 

 

 

 

I am generating a token based on my web api app in Azure being registered and having given it all the permissions that seem relevant. 

 

 

Any advice? I'm going spare trying to get this API to work - basically, I am trying to empty my dataset so I can reinsert my data again. Nothing I can do will make it get beyond the 403 error.

 

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Mattdjuk ,

     

    To enable your Azure AD app access objects such as reports, dashboards and datasets in the Power BI service, add the service principal or master user, as a member or admin to your workspace.

    For reference: Enable workspace access

    You may refer to your below offical blogs to learn more details about how to register an APP or Service Principal.

    For reference:

    Set up Power BI Embedded

    Embed Power BI content with service principal and an application secret

     

    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.

     

    • Mattdjuk's avatar
      Mattdjuk
      New Member

      I've tried this, it makes no difference - the result is the same

       

      Error obtaining tables: StatusCode: 403, ReasonPhrase: 'Forbidden', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
      {
        Strict-Transport-Security: max-age=31536000; includeSubDomains
        X-Frame-Options: DENY
        X-Content-Type-Options: nosniff
        Access-Control-Expose-Headers: RequestId
        request-redirected: true
        home-cluster-uri: https://wabi-uk-south-redirect.analysis.windows.net/
        RequestId: d2f2de1b-9ca9-4c1f-9a5f-5932db9148b5
        Date: Wed, 19 Apr 2023 07:50:02 GMT
        Content-Length: 51
        Content-Type: application/json; charset=utf-8
      }
      • mattiasdesmet's avatar
        mattiasdesmet
        Resolver II

        I also came across the error 403 frequently while first testing the API. I appeared I missed a few configuration items.

        I summarized it in this document Use Power BI APIs from Azure Data Factory - Mattias De Smet

        If it still doesn't work, you can provide your basic calls (which url, which method, which headers, etc...)? I noticed sometimes people use app.powerbi.com , which results in 403 because it has to be api.powerbi.com

  • GuillermoAM's avatar
    GuillermoAM
    Frequent Visitor

    Hi,
    Not sure if you have fixed the error but for me it happened the same and the solution was very simple.
    just go to the processor settings and unselect the Asynchonous Pattern and that's all.