Forum Discussion
Anonymous
7 years agoNot applicable
Unable to change parameter using Rest API
Hi, I am facing an issue while trying to change Report parameter values on power bi service using api request call using the syntax provided in the power bi documentation. The query that I am sen...
aramirez7
5 years agoFrequent Visitor
Try this:
dest = 'https://api.powerbi.com/v1.0/myorg/groups/' + self.group_id + '/datasets/' + self.dataset_id + '/Default.UpdateParameters'
body= {
"updateDetails": [
{
"name": "DataBase",
"newValue": "myDB"
},
{
"name": "Server",
"newValue": "123.456.789"
}
]
}
header = {'Content-Type': 'application/json'
,'Authorization': f'Bearer {tokenPBI}', 'Accept': 'text/plain'}
requests.post(dest,
data=json.dumps(body),
headers=header
)
Regards