library-rpc

Get a single book by id.

RPCbooks.get

Returns the book matching the given id.

Servers

•mock: https://mock.api.selfdochub.com/rpc

Parameters

NameInTypeRequiredDescription
idparamsstringyesThe book's unique identifier.

Responses

result The requested book.

application/json

FieldTypeRequiredDescription
authorIdstringyesThe id of the Author who wrote this book.
createdAtstring (date-time)yesWhen the book record was created.
idstringyesUnique identifier assigned by the server, prefixed with bk_.
isbnstringyesThe book's ISBN. Must be unique across the catalog.
publishedYearintegeryesThe year the book was first published. Must be between 1450 and next year.
statusstringyesA book's availability. "borrowed" means it is out on an open loan. Allowed values: available, borrowed
titlestringyesThe book's display title, 1-200 characters.
updatedAtstring (date-time)yesWhen the book record was last modified.

Errors

CodeMessageDescription
-32004Not found
-32602Invalid params

Request example

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "books.get",
  "params": {
    "id": "id_26"
  }
}

Response example

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "authorId": "authorId_76",
    "createdAt": "createdAt_445",
    "id": "id_292",
    "isbn": "isbn_512",
    "publishedYear": 269,
    "status": "available",
    "title": "title_177",
    "updatedAt": "updatedAt_619"
  }
}