Skip to content
Salvatore D'Agositno edited this page Oct 25, 2013 · 5 revisions

##NB: IDs for Events are using UUID-OOSP

Create

This will create a event

POST /events

##Sample Request Arguments(POST):

username : jsnow // Auth
password : test  // Auth
    event =>
    {
        "name"      : "test event date!",
        "userId"    : "1",
        "eventDate" :"2013-11-19 00:00:00"
    }

##Sample Response:

    {
        "error"   : false,
        "message" : "Created Event",
        "data"    : null
    }

Read Event

This function will return a event object to the client

GET /events/:id

##Sample Request Arguments(GET):

username : jsnow // Auth
password : test  // Auth

##Sample Response:

{
    "error"   : false,
    "message" : "Event Details",
    "data"    : [
        {
            "id"           : "0f33898d-5b72-46de-a9d2-277722f9ca28",
            "status"       : "1",
            "name"         : "test event date!",
            "creator"      : 1,
            "event_date"   : "2013-11-19T05:00:00.000Z",
            "date_created" : "2013-09-02T18:51:07.505Z",
            "date_updated" : "2013-09-02T18:51:07.505Z"
        }
    ]
}

Read Events

This function will get all events a user is part of

GET /users/:id/events

##Sample Request Arguments(GET):

username : jsnow // Auth
password : test  // Auth
start    : 1     // Optional
limit    : 1     // Optional

##Sample Response:

{
    "error"   : false,
    "message" : "Event List",
    "data"    : [
        {
            "id"           : 3,
            "status"       : "1",
            "name"         : "test event date!",
            "creator"      : 1,
            "event_date"   : "2013-11-19T05:00:00.000Z",
            "date_created" : "2013-10-18T00:57:36.903Z",
            "date_updated" : "2013-10-18T00:57:36.903Z",
            "event_id"     : "1ba08bb3-5128-4a15-a3de-933b806c9c7e",
            "user_id"      : 1,
            "permission"   : 2
        },
        {
            "id"           : 4,
            "status"       : "0",
            "name"         : "thisNameHasBeenUpdated",
            "creator"      : 1,
            "event_date"   : "2013-11-19T17:10:01.000Z",
            "date_created" : "2013-10-18T00:59:54.654Z",
            "date_updated" : "2013-10-18T01:16:16.856Z",
            "event_id"     : "6a72caef-cb9f-49d4-86ae-766daa6d3d2c",
            "user_id"      : 1,
            "permission"   : 2
        }
    ]
}

Update

This function will update an event by adding users to it

PUT /events

##Sample Request Arguments(PUT):

username : jsnow // Auth
password : test  // Auth
    event =>
    {
        "status": 1,
        "name": "thisNameHasBeenUpdated",
        "creator": 1,
        "eventDate":"2013-11-19 12:10:01"
    }

##Sample Response:

{
    "error"   : false,
    "message" : "Event updated",
    "data"    : null
}

Delete

This function will delete a event object from the DB

DELETE /events/:id

##Sample Request Arguments(DELETE):

username : jsnow // Auth
password : test  // Auth

##Sample Response:

{
    "error"   : false,
    "message" : "Deleted event",
    "data"    : null
}
Clone this wiki locally