How to create Alerts in Orchestrator using API endpoints?
Prerequisites to create Alerts in Orchestrator:
- OAuth required scopes: OR.Monitoring or OR.Monitoring.Write.
- Required permissions: Alerts.Create
A tool like Postman could be used to check and create an alert:
- Get the folder ID
- Go to headers (in Postman) and add X-UIPATH-OrganizationUnitId with the folder Id
- To get the folder ID, use the API or swagger and call the "odata/folders' endpoint :
- In Postman build the request as below:
- URL: https://ORCHESTRATOR_URL/odata/Alerts/UiPath.Server.Configuration.OData.RaiseProcessAlert
- Method: POST
- Authorization: Bearer Token
Example:
Headers:
Content-Type: application/json;odata.metadata=minimal;odata.streaming=true
Accept: application/json
X-UIPATH-OrganizationUnitId: FolderId
Example:
Body of type JSON:
{
"processAlert": {
"Message": "This is a sample Error alert.",
"Severity": "Error",
"RobotName": "marian.platonov@uipath.com-unattended",
"ProcessName": "Raise an Error Alert in Orchestrator"
}
}
"processAlert": {
"Message": "This is a sample Error alert.",
"Severity": "Error",
"RobotName": "marian.platonov@uipath.com-unattended",
"ProcessName": "Raise an Error Alert in Orchestrator"
}
}
Example:
Results in Orchestrator: