library-rpc

Get a single author, with their full books nested.

RPCauthors.get

Returns the author matching the given id, together with the full Book records (not just ids) for every book they have written.

Servers

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

Parameters

NameInTypeRequiredDescription
idparamsstringyesThe author's unique identifier.

Responses

result The requested author, with nested books.

application/json

FieldTypeRequiredDescription
biostringyesA short biography of the author.
booksarray of objectyesThe full Book records this author has written.
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.
idstringyesUnique identifier assigned by the server, prefixed with au_.
namestringyesThe author's full name.

Errors

CodeMessageDescription
-32004Not found
-32602Invalid params

Request example

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "authors.get",
  "params": {
    "id": "id_6"
  }
}

Response example

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "bio": "bio_242",
    "books": [
      {
        "authorId": "authorId_181",
        "createdAt": "createdAt_624",
        "id": "id_662",
        "isbn": "isbn_141",
        "publishedYear": 957,
        "status": "borrowed",
        "title": "title_849",
        "updatedAt": "updatedAt_578"
      }
    ],
    "id": "id_549",
    "name": "name_232"
  }
}