Skip to content

REST API description

Kuba Marchwicki edited this page Sep 15, 2013 · 1 revision

Following RESTful API endpoints are defined

Retrieving book information

Returns book information as described in yLibrary documents schema

Method URL

/rest/book/:isbn

Retrieving complete queue

This method retrieves basic information for all books together with status information (borrower and current queue) - as described in yLibrary documents schema

Method URL

/rest/queue

Adding user to queue

This method adds a user to a queue of a particular book and returns updated records

Method URL

/rest/queue/:isbn

Example request

> POST /rest/queue/9780470084113 HTTP/1.1
> Content-Type: application/json

{"username": "john"}

Example response

< HTTP/1.1 200 OK
< Content-Type: application/json; charset=utf-8

{
  "_id": "522f9677ebf33b57e1d1be52",
  "book": {
    "isbn": "9780470084113",
    "title": "About Face 3: The Essentials of Interaction Design",
    "image_url": "http://www.goodreads.com/assets/nocover/111x148.png",
    "authors": [
      "Alan Cooper"
    ]
  },
  "borrowed": false,
  "queue": [
    {
      "username": "john",
      "date": "2013-09-15T12:37:19.115Z"
    },
    {
      "username": "robert",
      "date": "2013-09-15T12:37:29.549Z"
    }
  ]

Clone this wiki locally