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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
amhiggins
Frequent Visitor

Rest API Data Refresh NotifyOption

Hello, I am refreshing my published datasets via the Rest API in Python. It seems as though I cannot turn on the NotifyOption in my request. Trying to set the notifyOption to "MailOnCompletion" or "MailOnFailure" produces a 400: Bad Request result. I'm not sure if there is something wrong with my set up or if this is simply not allowed.

Here is my code:

dataset_url = f"https://api.powerbi.com/v1.0/myorg/groups/{workspace_id}/datasets"
header = {'Authorization': f'Bearer {access_token}','Content-Type':'application/json'}
url = 'https://api.powerbi.com/v1.0/myorg/groups/' + workspace_id + '/datasets/' +datasetid+ '/refreshes'
payload = {'refreshRequest':'y', 'notifyOption':'MailOnCompletion'}
data = json.dumps(payload)
response = requests.request("POST", url, headers=header, data=data)

The output of this code is:

{"error":{"code":"InvalidRequest","message":"NotifyOption parameter value is not supported for application requests","target":"Parameter value 'MailOnCompletion' is invalid for application requests"}}

If I remove the notifyOption or set notifyOption to "NoNotification" the request works fine and the desired dataset is refreshed. 

1 REPLY 1
Anonymous
Not applicable

Hi @amhiggins ,

 

I can't reproduce the scenario.

You may take a look at this topic.

https://community.powerbi.com/t5/Developer/PowerBI-REST-API/m-p/1007546 

 

Best Regards,

Jay

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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