Events API
Whenever anything interesting happens to a service, an event is created.
Attributes
- sid
- The unique identifier by which to identify the event
- message
- The message associated with this event
- timestamp
- The time at which this event occurred, given in RFC 1132 format.
- url
- The URL of the specific event resource
- status
- The status of this event, as described by the Statuses resource
- informational
- This determines if event is a note or event
List all events for a service
GET /api/v1/services/{service-id}/events
{
"events": [
{
"informational": false,
"timestamp": "Mon, 28 Jun 2010 22:17:06 GMT",
"message": "Problem fixed",
"sid": "ahJpc215d2Vic2VydmljZWRvd25yCwsSBUV2ZW50GBAM",
"url": "/api/v1/services/example-service/events/ahJpc215d2Vic2VydmljZWRvd2",
"status": {
"id": "down",
"name": "Down",
"description": "An explanation of what this status represents",
"level": "ERROR",
"image": "/images/status/cross-circle.png",
"url": "/api/v1/statuses/down",
},
},
{
"informational": false,
"timestamp": "Mon, 28 Jun 2010 22:18:06 GMT",
"message": "Might be up",
"sid": "ahJpc215d2Vic2VydmljZWRvd25yCwsSBUV2ZW50GA8M",
"url": "/api/v1/services/example-service/events/ahJpc215d2Vic..."
"status": {
"id": "down",
"name": "Down",
"description": "An explanation of what this status represents",
"level": "ERROR",
"image": "/images/status/cross-circle.png",
"url": "/api/v1/statuses/down",
},
}
]
}
Filter serice events by date
The Events List resource also supports filtering events via dates. To filter events, place on of the following options into the query string for a GET request. While the format of these parameters is very flexible, we suggested either the RFC 2822 or RFC 1123 format due to their support for encoding timezone information.
Filter Options
- start
- Only show events which started after this date, inclusive.
- end
- Only show events which started before this date, inclusive.
GET /api/v1/services/{service-id}/events?start=2010-06-10
Returns all events starting after June 6, 2010. Similarly, both "start" and "end" can be used to create date ranges
GET /api/v1/services/{service-id}/events?end=2010-06-17&start=2010-06-01
Return all events between June 6, 2010 and June 17, 2010
Get the current event for a service
GET /api/v1/services/{service-id}/events/current
{
"informational": true,
"timestamp": "Mon, 28 Jun 2010 22:17:06 GMT",
"message": "Might be up",
"sid": "ahJpc215d2Vic2VydmljZWRvd25yCwsSBUV2ZW50GA8M",
"url": "/api/v1/services/example-service/events/ahJpc215d2Vic2VydmljZWRvd25yCwsSBUV2ZW50GA8M",
"status": {
"id": "down",
"name": "Down",
"description": "An explanation of what this status represents",
"level": "ERROR",
"image": "/images/status/cross-circle.png",
"url": "/api/v1/statuses/down",
},
}
Get an individual event
GET /api/v1/services/{service-id}/events/{event-sid}
{
"informational": false,
"timestamp": "Mon, 28 Jun 2010 22:17:06 GMT",
"message": "Might be up",
"sid": "ahJpc215d2Vic2VydmljZWRvd25yCwsSBUV2ZW50GA8M",
"url": "/api/v1/services/example-service/events/ahJpc215d2Vic2VydmljZWRvd25yCwsSBUV2ZW50GA8M",
"status": {
"id": "down",
"name": "Down",
"description": "An explanation of what this status represents",
"level": "ERROR",
"image": "/images/status/cross-circle.png",
"url": "/api/v1/statuses/down",
}
}