cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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

Accepted Solutions
yoavo Frequent Visitor
Frequent Visitor

Re: Updating parameters through the service API

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 Frequent Visitor
Frequent Visitor

Re: Updating parameters through the service API

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

Anonymous
Not applicable

Re: Updating parameters through the service API

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 

ashahin Frequent Visitor
Frequent Visitor

Re: Updating parameters through the service API

Hi,

 

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

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 194 members 2,427 guests
Please welcome our newest community members: