library-rpc
Partially update a book.
RPC
books.updateApplies only the parameters present in the call; omitted parameters are left unchanged. The book's status cannot be changed here — it only changes via loans.borrow and loans.return, so it always reflects a real open loan.
Servers
•
mock: https://mock.api.selfdochub.com/rpcParameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | params | string | yes | The book's unique identifier. |
| title | params | string | The book's new display title, 1-200 characters. | |
| isbn | params | string | The book's new ISBN. Must be unique across the catalog. | |
| authorId | params | string | The id of a different existing Author to reassign this book to. | |
| publishedYear | params | integer | The book's new published year. Must be between 1450 and next year. |
Responses
result The updated book.
application/json
| Field | Type | Required | Description |
|---|---|---|---|
| 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. |
Errors
| Code | Message | Description |
|---|---|---|
| -32602 | Invalid params | |
| -32004 | Not found | |
| -32001 | Conflict |
Request example
{
"id": 1,
"jsonrpc": "2.0",
"method": "books.update",
"params": {
"authorId": "authorId_844",
"id": "id_365",
"isbn": "isbn_574",
"publishedYear": 344,
"title": "title_266"
}
}Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"authorId": "authorId_433",
"createdAt": "createdAt_317",
"id": "id_680",
"isbn": "isbn_361",
"publishedYear": 260,
"status": "available",
"title": "title_448",
"updatedAt": "updatedAt_871"
}
}