library-rpc
Get a single author, with their full books nested.
RPC
authors.getReturns 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/rpcParameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | params | string | yes | The author's unique identifier. |
Responses
result The requested author, with nested books.
application/json
| Field | Type | Required | Description |
|---|---|---|---|
| bio | string | yes | A short biography of the author. |
| books | array of object | yes | The full Book records this author has written. |
| authorId | string | yes | The id of the Author who wrote this book. |
| createdAt | string (date-time) | yes | When the book record was created. |
| id | string | yes | Unique identifier assigned by the server, prefixed with bk_. |
| isbn | string | yes | The book's ISBN. Must be unique across the catalog. |
| publishedYear | integer | yes | The year the book was first published. Must be between 1450 and next year. |
| status | string | yes | A book's availability. "borrowed" means it is out on an open loan. Allowed values: available, borrowed |
| title | string | yes | The book's display title, 1-200 characters. |
| updatedAt | string (date-time) | yes | When the book record was last modified. |
| id | string | yes | Unique identifier assigned by the server, prefixed with au_. |
| name | string | yes | The author's full name. |
Errors
| Code | Message | Description |
|---|---|---|
| -32004 | Not found | |
| -32602 | Invalid 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"
}
}