Skip to content

HTTP Status and Responses

Damien Hogan edited this page Feb 13, 2015 · 4 revisions

Here you will find the requests, their status codes and responses.

GET

Method URI Params Value HTTP Headers
GET api/v1/user/:id id Integer 'Accept' 'application/json'

Status

200

Response

{
    "id": 10,
    "username": "alanpartridge",
    "email": "[email protected]",
    "password_hash": "$2a$10$uhUIUmVWVnrBWx9rrDWhS.CPCWCZsyqqa8./whhfzBZydX7yvahHS",
    "password_salt": "$2a$10$uhUIUmVWVnrBWx9rrDWhS.",
    "created_at": "2015-02-14T20:05:26.433Z",
    "updated_at": "2015-02-14T20:05:26.540Z"
}

Status

400

Response

400 Bad Request

POST

Method URI Params Value HTTP Headers
POST api/v1/user username
email
password
String
String
String
'Accept' 'application/json'
'Content-Type' 'application/json'

Status

201

Response

{  
   "id":9,
   "username":"alanshearer",
   "email":"[email protected]",
   "password_hash":"$2a$10$iTUWyQKTsgp6nIKElYhd3.WeYnxidQHhw2P2b0NvGW0V8Uk9z8l0.",
   "password_salt":"$2a$10$iTUWyQKTsgp6nIKElYhd3.",
   "created_at":"2015-02-14T20:44:10.904Z",
   "updated_at":"2015-02-14T20:44:11.012Z"
}

Status

400

Response

400 Bad Request

DELETE

Method URI Params Value HTTP Headers
DELETE api/v1/user id Integer 'Accept' 'application/json'
'Content-Type' 'application/json'
'Authorization' 'Token token="foobar"'

Status

204

Response

204 No Content

Status

401

Response

HTTP Token: Access denied.

Status

400

Response

400 Bad Request