threefunkymonkeys/chist — pull request #75 by kandalf (2014-12-21 15:49:00+00:00)
Title: Chist API

This PR defines the Chist API, and exposes the chist creation endpoint `POST /chists`.

The API calls are determined by the presence of the following headers:

* `Content-Type: application/json`
* `Accept: application/json`
* `Authorization: [API Key]`

The _API Key_ in the `Authorization` header should be defined by the user in the web UI ( See #73 )
If the request is missing any one of the keys above, it will be taken as a regular request (as if it's done by a browser) and will be redirected to the login page.

The chist attributes must go in the request's body JSON formatted. For example:
```
params = {:chist => { :title => "Test", :format => "irc", :chist => "19:22 message"}}

post '/chists', params.to_json
```
API documentation is still a TO-DO.

Refs #69