For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.
Custom webhook
We can set up a distribution method for our alert. One option is to define a custom web hook to which a payload is sent, when an alert threshold is triggered. We can also specify a set of optional headers, and basic auth credentials if your endpoint is protected by basic auth.
By default, the POST request has a Content-Type of application/json. The following example shows a sample payload.
{ "timestamp": 1442848504431, "condition": {"value":5.0,"operator":"GTE"}, "value": "CRASH", "offenders": [ { "XXX 1.0": 5.0 }, { "XXX 2.0": 1.0 } ], "property":"closedBy", "eventType":"MfpAppSession", "title":" Crash Count Alert for Application ABC", "message": "The crash count for a application ABC exceeded XYZ. View the Crash Summary table in the Crashes tab in the Apps section of the MobileFirst Analytics Console to see a detailed stacktrace of this crash instance." }
The POST request includes the following attributes.
- timestamp - the time at which the alert notification was created.
- condition - the threshold that was set by the user (for example, greater than or equals 5).
- eventType - the eventType that was queried.
- property - the property of the eventType that was queried.
- value - the value of the property that was queried.
- offenders - a list of apps or devices that triggered the alert.
- title - the user-defined title.
- message - the user-defined message.
Parent topic: Alerts