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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Updating parameters through the service API

We are using parameters to change our database dynamically in reports deployed to the Power BI service. It works great. Now I'd like to be able to do more through API calls as opposed to manually updating things in the service.

 

I'm using Postman for all my testing and can authenticate, and get a token, list groups, reports, and datasets, and even dataset parameters no problem, but when trying to make a call to update the parameter values I get an error, and I can't find any information about it.

 

Once authenticated I'm making the following call

https://api.powerbi.com/v1.0/myorg/groups/xxxmygroupidxxx/datasets/xxxmydatasetidxxx/Default.UpdateP...

 

with a json body of

{
  "updateDetails": [
    {
      "name": "DatabaseServer",
      "newValue": "xyz"
    },
    {
      "name": "DatabaseName",
      "newValue": "123"
    }
  ]
}

 

and it returns:

{
    "error": {
        "code": "InvalidRequest",
        "message": "This operation is only supported for the dataset owner"
    }
}

 

 

which I don't really understand as I am the dataset owner

1 ACCEPTED SOLUTION
yoavo
Employee
Employee

My guess is that you are NOT the same user when you use the APIs, as when you login to the portal. You probably are within the same tenant/group (as you can see the data), but not allowed to modify datasets in the way the owner can.

Do other “Write” APIs work for you? For example Update Datasources (see https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updatedatasources)? I think you will get the same error.

 

You can try (via API, with the same authentication you do) to Take Over the dataset (https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/takeoveringroup) after that, you should be able to execute Update parameters. Also, if you then get into the Portal UI (with the original credentials you use now) and go to the Schedule Refresh page of the dataset, you will see who the owner is now (once you are not the owner, a line appears there saying “the dataset has been configured by …….. Would you like to take over the setting?”

 

Also, in the future when you post a request/response, please paste the entire raw data (you can remove the authentication token…) so we can see the request Id etc. and if necessary, investigate in our internal logging.

View solution in original post

3 REPLIES 3
yoavo
Employee
Employee

My guess is that you are NOT the same user when you use the APIs, as when you login to the portal. You probably are within the same tenant/group (as you can see the data), but not allowed to modify datasets in the way the owner can.

Do other “Write” APIs work for you? For example Update Datasources (see https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updatedatasources)? I think you will get the same error.

 

You can try (via API, with the same authentication you do) to Take Over the dataset (https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/takeoveringroup) after that, you should be able to execute Update parameters. Also, if you then get into the Portal UI (with the original credentials you use now) and go to the Schedule Refresh page of the dataset, you will see who the owner is now (once you are not the owner, a line appears there saying “the dataset has been configured by …….. Would you like to take over the setting?”

 

Also, in the future when you post a request/response, please paste the entire raw data (you can remove the authentication token…) so we can see the request Id etc. and if necessary, investigate in our internal logging.

Anonymous
Not applicable

As obvious as it should have been you were indeed right. I was publishing reports to a workspace owned by another account. The other account can not act on them through the API until ownership is transfered 

Anonymous
Not applicable

Hi,

 

I am facing the same issue, were you able to resolve this?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.