Skip to content
marktyers edited this page Feb 2, 2014 · 13 revisions

Adds the book based on the supplied ISBN number

Authentication

None

Resource URL

http://localhost:3000/book

Parameters


Type Name Description Example
URI isbn The ISBN of the book to add ssssss
HEAD authorisation a base64 encoded string (username:password) ssssss
BODY genre the id of the appropriate genre ssssss

(the required genre id)

Example Request

http://localhost:3000/book/9780439023481

Example Response

{
  "status": "success",
  "selflink": "http://localhost:3000/book/9781407139807",
  "book": {
    "isbn": 9781407139807,
    "title": "Catching Fire",
    "author": "Suzanne Collins",
    "cover": "http://localhost:3000/covers/9781407139807.jpg",
    "year": 2013,
    "genreid": 24
  }
}

cURL Test

curl -i -H "Accept: application/json" -X PUT -d "genre=24" http://localhost:3000/book/9780439023481

Clone this wiki locally