Events

Events are the primary resource in Loggr. They are contained in an Event Log. Creating events through this API is not supported. In order to create events, please see Posting events.

List All
List One
Create
Delete

List All

Returns all events contained in the log identified by {logkey}.

URL

GET /logs/{logkey}/events

Request

// This example returns the next 10 events that were posted 
// since the event with id=3dfdff994e1feb0b4c0020ef was posted

GET /logs/foo/events?order=desc&pagesize=10&sinceid=3dfdff994e1feb0b4c0020ef

When making a request for all events you can specify some additional parameterts to control what event come back.
Parameter (optional) Value Type Default Value Notes
pagenum number 1
pagesize number 100 max is 500
order string asc asc or desc
tags string space delimited list of tags to match
text string text to match (can be regex)
sinceid string id of event to get new events since
source string source to match
user string user to match
class string class to match
created string javascript Date.UTC value. bottom value like: 1268956800000 or range like: 1268956800000:1268956837594

Response

Status: 200 OK

[
    {
        "id":"4dfdff994e1feb0b4c0020ef",
        "created":"\/Date(1308491673911)\/",
        "text":"A user was created",
        "link":"",
        "hash":"LiWqANduFe+cia1nMTfN+g==",
        "tags":["user","created"],
        "source":"web3",
        "log":"sample"
        "class":"created",
        "data":true,
        "geo":null,
        "value":null
    }
]
top

List One

Returns a single event. This call will only work for events that are contained in the log identified by {logkey}.

URL

GET /logs/{logkey}/events/{id}

Request

No request data is sent

Response

Status: 200 OK

{
    "id":"4dfdff994e1feb0b4c0020ef",
    "created":"\/Date(1308491673911)\/",
    "text":"A user was created",
    "link":"",
    "hash":"LiWqANduFe+cia1nMTfN+g==",
    "tags":["user","created"],
    "source":"web3",
    "log":"sample"
    "class":"created",
    "data":true,
    "geo":null,
    "value":null
}
top

Create

Creating events through this API is not supported. In order to create events, please see Posting events.

Response

Status: 400 Bad Request
top

Delete

Removes the event at the referenced URL. In the URL, {id} is the id of the event to remove. This call will only work for events that are contained in the log identified by {logkey}.

Note

Only users having the "admin" role can delete events.

URL

DELETE /logs/{logkey}/events/{id}

Request

No request data is sent

Response

Status: 204 No Content
top