Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Parameter notifyOption fails by refreshing dataset via API

Hello,

 

We are refreshing our datasets in Power BI by using the rest API.  This works fine.  But now we want to receive notifications by email when the refresh from the dataset fails.

 

Therefor we tried to add the following json in de request body:

 

{
  "NotifyOption""MailOnFailure"
}
 
But if we do so, the request fails (also using postman). We get the following error:
 
{
    "error": {
        "code""InvalidRequest",
        "message""NotifyOption parameter value is not supported for application requests",
        "target""Parameter value 'MailOnFailure' is invalid for application requests"
    }
}
 
If we change the NotifyOption to "NoNotification", we don't get an error anymore.
 
We are refreshing with a Power BI service principal account, which has the following permissions.
 

 

 
Does anyone know how to fix this error?
 
Thanks,
 
Nele
 

1 Reply

  • nitishsh91's avatar
    nitishsh91
    Icon for Solution Supplier rankSolution Supplier

    Hi Anonymous 

     

    You can call below API to find the dataset refresh history:

    https://api.powerbi.com/v1.0/myorg/groups/{workspaceGuid}/datasets/{datasetGuid}/refreshes?$top=1

     

    That's what we use to find out the refresh history post triggering the dataset refresh via API.