kevhav
8 years agoContinued Contributor
Status:
New
Power BI REST API - notify on refresh failure not working
I am successfully using the "Refresh Dataset In Group" API: https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/refreshdatasetingroup To get the access token, I am using grant_type=passw...
kevhav
8 years agoContinued Contributor
Hi v-qiuyu-msft,
I tested this in Postman, with Fiddler running, to get the HTTP trace data for you.
However, when I tested it with Postman, it worked! I did receive an email notification, after the dataset refresh failed.
Normally, I am calling the API with a Python script, using Python's "requests" library. I tried some different things, and I discovered that the issue was with my Python syntax.
In Python, I had been creating the body of the HTTP request as a JSON type, like this:
httpBody = {
'notifyOption': 'MailOnFailure'
}I figured the above would work, because in Python, it works to create the HTTP headers as a JSON type.
But I was wrong! After I changed the HTTP body to a string type, it fixed it...like this:
httpBody = '{\"notifyOption\": \"MailOnFailure\"}'So, you can close this. Thanks.