API documentation

Add new Car

POST /api/cars

Include access_token in HTTP header:

Authorization: Bearer 09ba487fc3df...

Description

This web service adds a new car to the users cars list.

REQUEST PARAMETERS

Parameter name Parameter type Description
plate_number string plate number of the new car
{
"plate_number" :"BN88TITUS"
}

Response

Status Code: 201 if OK

{
    "id": 55,
    "plate_number": "BN88TITUS"
    "created_at": "2014-07-25T00:00:00Z",
    "updated_at": "2014-07-25T00:00:00Z"
}
Parameter name Parameter type Description
id int id of the new car
plate_number string plate number of the new car
created_at string date when the car was created
updated_at string date when the car was updated

Status Code: 422 if car exists in the list

{
    "plate_number": [
        "is already in your list"
    ]
}

Status Code: 401 if request not ok