Events
An analytic event is created each time an alert has been triggered or acknowledged. Each event has an associated task_id
that is the returned value from the response of an alert API call.
Analytic events also have an associated name
field for correlation that can be programmatically set when an alert is sent via the /alerts
endpoint. See Customizing Your Alerts.
Events can be retrieved through a simple GET
request to our server into our /events
endpoint.
The GET
command to send the broadcast should take the following form:
Headers and Subscriber ID Path
apikey
: you should contact Relay to get your API key, as it is not available via self-service. Your key should be included within the Authorization header. Don’t forget to include “RelayApiKey” before your actual key.id
: your subscriber ID, which can be found on the Relay Dash through Help → Server Details under Subscriber
Optional Query Parameters
oldest
: An iso8601 timestamp which defaults to 7 days agolimit
: The maximum number of events returned which defaults to 100
Example
The following example shows a curl command that retrieves the oldest analytic event from August 8th from our server.
In the JSON object that gets returned, the content
field has the detailed information about the event and the following fields determine what kind of analytic event it is:
task
: The JSON object for the specific eventid
: Unique identifier for the event that should match what was returned when the event was triggeredname
: Correlation identifier that can be set when event is triggered, defaults toalert
type
: This field represents the kind of event that is being returned and can equal the following:start
: event for when the alert was triggeredend
: event for when the alert is completed (through time out, acknowledgement or error)acknowledged
: event for when device acknowledges an alerttimed_out
: event for when an alert times out and no one has acknowledged it
device
: This field will be present if the eventtype
isacknowledged
and represented the user profile associated with the device that acknowledged the alertstatus
: This field will be present if the eventtype
isend
and the alert has been completed, if the alert was completed without error this should equalnormal
The following is an example of the content
field for an event for when an alert was triggered:
The following is an example of the content
field for an event for when an alert was acknowledged by user 'bob' on a device or virtual account:
The following is an example of the content
field for an event for when an alert that timed out:
The following is an example of the content
field for an event for when an alert was completed:
Last updated