Skip to content
This repository has been archived by the owner on Mar 11, 2019. It is now read-only.

API Reference

Patrick Tone edited this page Mar 21, 2017 · 7 revisions

Contents

Events

Method Endpoint Verb Description
CreateEvent /events POST Creates an event from a JSON representation
GetEvent /events/:uid GET Returns an event
EditEvent /events/:uid PUT Modify the event. Skipped fields will not change
DeleteEvent /events/:uid DELETE Delete an event
[//]: # ( GetAllReports /events/:uid/reports GET

CreateEvent

Creates an event from a JSON representation.

  • Endpoint: /events

  • Verb: GET

  • Request:

    {
      "creator": {
        "uid": "5"
      },
      "category": {
        "uid": "27",
        "name": "presentation",
        "points": "1"
      },
      "dateTime": "yyyyMMddhhmmss",
      "location": "1234 ABC Street",
      "title": "Time - A Presentation On Time Management",
      "description": "A presenter will come speak about the...",
      "image": ""
    }
  • Response:

    STATUS 200 - Returns a link to the created event

    {
      "uid": "12",
      "url": "https://www.this.com/events/12"
    }

    STATUS 400 - Returned if input is invalid

    {
      "errors": [
        "An event title is required",
        "Event time is invalid"
      ]
    }

GetEvent

EditEvent

DeleteEvent

Reports

Method Endpoint Verb Description
CreateReport /reports POST Creates an report from a JSON representation
GetReport /reports/:uid GET Returns a report
EditReport /reports/:uid PUT Modify the report. Skipped fields will not change
DeleteReport /reports/:uid DELETE Delete a report

CreateReport

GetReport

EditReport

DeleteReport

Users

Method Endpoint Verb Description
CreateUser /users POST Creates an user from a JSON representation
GetUser /users/:uid GET Returns a user
EditUser /users/:uid PUT Modify the user. Skipped fields will not change
DeleteUser /users/:uid DELETE Delete a user

CreateUser

GetUser

EditUser

DeleteUser

Auth

Method Endpoint Verb Description
Login /auth POST Start a session with a valid email/password and returns a token
Logout /auth DELETE Given a token, destroy the given token
Create /auth/create POST Create a auth_user with a email/password
Role /auth GET Given a token, returns the associated user role