Forum Discussion

bi_small_potato's avatar
bi_small_potato
Frequent Visitor
1 year ago
Solved

Python Rest API Python 404 ExecuteQueries

I am using power bi rest api by python to get the table data using service principal. I had enable all the required settings under the tenant settings and able to get groups report through the api. However when i try to executeQueries it keep show 404 error : No HTTP resource was found that matches the request URI

url = 'https://api.powerbi.com/v1.0/myorg/groups/{groupID}/datasets/{datasetID}/executeQueries'

query_payload = '''{
                        "queries": [
                            {
                                "query": "EVALUATE VALUES(Mytable)"  
                            }
                        ]
                        }'''
        response = requests.get(url, json=query_payload, headers=header )
I had enable Semantic Model Execute Queries REST API under Integration Settings and also all the service principal related settings, for the serviceprincipal also enable dataset.ReadWrite.all permission , what else i can do to solve the problem ? 

6 Replies

Replies have been turned off for this discussion
  • bi_small_potato 

    Error message indicates, Resource not found

    1. Have you added services principal to the worksapce as a Contributor or greater role?

    2. Have you passed the workspace id (group id) and dataset ID process in the API endpoint ?

    3. Please test the dax query that you would like to run in DAX query view or DAX studio 

     

    I am assuming you enabled, necessary admin settings at the tenant level required to executive Power BI APIs with service principal and you also enabled Executive DAX queries option. 

     

    The URL that you shared seems to be the API endpoint temaplate, while running the API you need to replace the dataset id with your semantic model ID and group id with your workspace ID, I am assuming you have done that

     

    Need a Power BI Consultation? Hire me on Upwork

     

     

     

    Connect on LinkedIn

     

     

     








    Did I answer your question? Mark my post as a solution!
    If I helped you, click on the Thumbs Up to give Kudos.

    Proud to be a Super User!


    • tharunkumarRTK's avatar
      tharunkumarRTK
      Super User

      Is this option enabled in your tenant?

      If you dont have permissions to reach tenant admin portal then you can run the same api with your user id and its token. If that works then its an issue this setting. Also have you verified the other limitations documented here  

      https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/execute-queries

      Is there any RLS configured for your dataset? Please re validate all the limitations

       

      Need a Power BI Consultation? Hire me on Upwork

       

       

       

      Connect on LinkedIn

       

       

       








      Did I answer your question? Mark my post as a solution!
      If I helped you, click on the Thumbs Up to give Kudos.

      Proud to be a Super User!


      • bi_small_potato's avatar
        bi_small_potato
        Frequent Visitor

        yes , i had enable these settings , and the dataset had no RLS .