because cats are awesome, i want to save all videos i can find about them
Url
POST https://myservice.com/api/cat_videosHeaders
Accept: application/json, application/vnd.myservice+json; version=2
Authorization: Bearer asdf987asd0f987a0s9d8f...Body/Parameters
{
"cat_video": {
"name": "cat falling sleep",
"comment": "aaawww",
"url": "https://youtube.com/W/OIYOIUyO"
}
}Status Code: 201 Created
Headers
Content-Type: application/json
Etag: \W"halskjdho8733halk82"Body
{
"id": 345,
"created_at": "2015-06-10T12:30:42+01:00",
"updated_at": "2015-06-10T12:30:42+01:00",
"name": "cat falling sleep",
"comment": "aaawww",
"url": "https://youtube.com/W/OIYOIUyO"
}Some of the error cases that can occur, with causes are:
400 Bad Request: when the user doesn't send thecat_videoobject422 Unprocessable Entity:- when
nameorurlare missing forcat video - when
urlis already on the system
- when
401 Unauthorized: the token is invalid or expired403 Forbidden: you don't have permissions to add videos of cats anymore