Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

PowerBI API - 400 Bad Request - On postman

I tried Power BI API in postman 

Generate access token:

  • I created an app in azure,created certificate
  • Updated PowerBI API permissions
  • Gave access to the app in Power BI dashboard

Response Body:

{
    "token_type": "Bearer",
    "expires_in": 3599,
    "ext_expires_in": 3599,
    "access_token": "ey....Q"
}
GET request:

  

  Body:

{
    "accessLevel":"View",
    "allowSaveAs" : "false"
}
 
But I still 400 Bad request error
 

Please help 

 

  • Hi Anonymous ,

     

    It works when i try it. Did you change the host in the headers?

     

    Best Regards

    Community Support Team _ chenwu zhu

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 Replies

  • v-chenwuz-msft's avatar
    v-chenwuz-msft
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

     

    Your calling url should be "https://api.powerbi.com/v1.0/myorg/GenerateToken" and dataset and report id should be contained in body.

     

    You can try this  in Embed Token - Generate Token - REST API (Power BI Power BI REST APIs) | Microsoft Learn

     

    Best Regards

    Community Support Team _ chenwu zhu

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello v-chenwuz-msft 

      Thank you for the reply,

      I still get this error in postman 

      but it worked in the microsoft try it. any idea if I am going wrong somewhere?

      • v-chenwuz-msft's avatar
        v-chenwuz-msft
        Icon for Community Support rankCommunity Support

        Hi Anonymous ,

         

        It works when i try it. Did you change the host in the headers?

         

        Best Regards

        Community Support Team _ chenwu zhu

         

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.