docs: remove old books API documentation
Endpoints moved to /api/media-items/, so delete the books/ directory. Includes bulk_delete_books.md, bulk_update_books.md, and download_book.md.
This commit is contained in:
@@ -1,48 +0,0 @@
|
||||
# Bulk Delete Books
|
||||
|
||||
Delete multiple media items at once.
|
||||
|
||||
**Endpoint**: `POST /api/books/bulk-delete`
|
||||
**Auth**: Required
|
||||
**Content-Type**: `application/json`
|
||||
|
||||
## Request Body
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
|--------|------|-----------|-------------|
|
||||
| media_item_ids | array of UUID | Yes | Array of media item UUIDs to delete |
|
||||
|
||||
### Example Request
|
||||
|
||||
```json
|
||||
{
|
||||
"media_item_ids": [
|
||||
"550e8400-e29b-41d4-a716-446655440001",
|
||||
"660e8400-e29b-41d4-a716-446655440002",
|
||||
"770e8400-e29b-41d4-a716-446655440003"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Response (200 OK)
|
||||
|
||||
```json
|
||||
{
|
||||
"message": "Books deleted successfully",
|
||||
"deleted_count": 3,
|
||||
"failed_count": 0
|
||||
}
|
||||
```
|
||||
|
||||
## Error Responses
|
||||
|
||||
| Code | Description |
|
||||
|------|-------------|
|
||||
| 400 | Invalid request data |
|
||||
| 401 | Invalid or expired token |
|
||||
| 403 | User does not have permission |
|
||||
| 404 | One or more media items not found |
|
||||
|
||||
## Try It Out
|
||||
|
||||
<!-- API Explorer will be inserted here in Phase 3 -->
|
||||
@@ -1,96 +0,0 @@
|
||||
# Bulk Update Books
|
||||
|
||||
Update multiple media items at once.
|
||||
|
||||
**Endpoint**: `POST /api/books/bulk-update`
|
||||
**Auth**: Required
|
||||
**Content-Type**: `application/json`
|
||||
|
||||
## Request Body
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
|--------|------|-----------|-------------|
|
||||
| updates | array of objects | Yes | Array of update operations (see below) |
|
||||
|
||||
### Update Object
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
|--------|------|-----------|-------------|
|
||||
| book_id | string (UUID) | Yes | Media item UUID to update |
|
||||
| updates | object | Yes | Fields to update (see below) |
|
||||
|
||||
### Update Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
|--------|------|-----------|-------------|
|
||||
| title | string | No | Updated title |
|
||||
| author | string | No | Updated author |
|
||||
| genre | string | No | Updated genre |
|
||||
| language | string | No | Updated language |
|
||||
| tags | array of strings | No | Updated tags (auto-normalized) |
|
||||
| contributors | array of strings | No | Updated contributors (auto-normalized) |
|
||||
|
||||
### Example Request
|
||||
|
||||
```json
|
||||
{
|
||||
"updates": [
|
||||
{
|
||||
"book_id": "550e8400-e29b-41d4-a716-446655440001",
|
||||
"updates": {
|
||||
"title": "Updated Title",
|
||||
"genre": "Science Fiction",
|
||||
"tags": ["science fiction", "non-fiction", "ACME CORP."]
|
||||
}
|
||||
},
|
||||
{
|
||||
"book_id": "660e8400-e29b-41d4-a716-446655440002",
|
||||
"updates": {
|
||||
"author": "Updated Author",
|
||||
"contributors": ["O'Reilly Media", "Penguin Random House"]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Response (200 OK)
|
||||
|
||||
```json
|
||||
{
|
||||
"results": [
|
||||
{
|
||||
"book_id": "550e8400-e29b-41d4-a716-446655440001",
|
||||
"success": true
|
||||
},
|
||||
{
|
||||
"book_id": "660e8400-e29b-41d4-a716-446655440002",
|
||||
"success": true
|
||||
}
|
||||
],
|
||||
"total": 2,
|
||||
"success": 2,
|
||||
"failed": 0
|
||||
}
|
||||
```
|
||||
|
||||
## Tag and Contributor Normalization
|
||||
|
||||
The backend automatically normalizes tags and contributors:
|
||||
|
||||
- **Tags**: Titlecased, punctuation preserved, deduplicated
|
||||
- **Contributors**: Original casing preserved, punctuation preserved
|
||||
- **Search fields**: Lowercase, no punctuation, stored in `tags_search` and `contributors_search`
|
||||
|
||||
## Error Responses
|
||||
|
||||
| Code | Description |
|
||||
|------|-------------|
|
||||
| 400 | Invalid request data |
|
||||
| 401 | Invalid or expired token |
|
||||
| 403 | User does not have permission |
|
||||
| 404 | One or more media items not found |
|
||||
|
||||
## Try It Out
|
||||
|
||||
<!-- API Explorer will be inserted here in Phase 3 -->
|
||||
@@ -1,56 +0,0 @@
|
||||
# Download Book
|
||||
|
||||
Download a book file.
|
||||
|
||||
**Endpoint**: `GET /api/books/:uuid/download`
|
||||
**Auth**: Not required (public endpoint)
|
||||
|
||||
## Path Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|-----------|-------------|
|
||||
| uuid | string (UUID) | Yes | Media item UUID |
|
||||
|
||||
## Request Headers
|
||||
|
||||
| Header | Type | Required | Description |
|
||||
|--------|------|-----------|-------------|
|
||||
| Authorization | string | No* | Bearer token (required if media item is not public) |
|
||||
|
||||
\* If the media item is in a non-public library, authentication is required.
|
||||
|
||||
### Example Request
|
||||
|
||||
```http
|
||||
GET /api/books/550e8400-e29b-41d4-a716-446655440000/download
|
||||
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
|
||||
```
|
||||
|
||||
## Response (200 OK)
|
||||
|
||||
Binary file download with appropriate Content-Type header.
|
||||
|
||||
**Possible Content-Types:**
|
||||
- application/epub+zip
|
||||
- application/pdf
|
||||
- application/x-mobipocket-ebook
|
||||
- application/octet-stream
|
||||
|
||||
**Headers:**
|
||||
```
|
||||
Content-Type: application/epub+zip
|
||||
Content-Disposition: attachment; filename="book-title.epub"
|
||||
Content-Length: 1234567
|
||||
```
|
||||
|
||||
## Error Responses
|
||||
|
||||
| Code | Description |
|
||||
|------|-------------|
|
||||
| 401 | Authentication required for non-public content |
|
||||
| 404 | Media item not found |
|
||||
| 404 | Book file not found on disk |
|
||||
|
||||
## Try It Out
|
||||
|
||||
<!-- API Explorer will be inserted here in Phase 3 -->
|
||||
Reference in New Issue
Block a user