Update configuration key naming convention to use snake_case consistently. Applies changes recursively across all subdirectories.
101 lines
2.0 KiB
Plaintext
101 lines
2.0 KiB
Plaintext
meta {
|
|
name: Bulk Remove Books - All Books
|
|
type: http
|
|
seq: 5
|
|
}
|
|
|
|
post {
|
|
url: {{base_url}}/api/collections/{{collection_id}}/books/bulk-remove
|
|
body: json
|
|
auth: inherit
|
|
}
|
|
|
|
headers {
|
|
Content-Type: application/json
|
|
}
|
|
|
|
body:json {
|
|
{
|
|
"book_ids": [
|
|
"{{bookId1}}",
|
|
"{{bookId2}}",
|
|
"{{bookId3}}"
|
|
]
|
|
}
|
|
}
|
|
|
|
settings {
|
|
encodeUrl: true
|
|
timeout: 0
|
|
}
|
|
|
|
docs {
|
|
## Bulk Remove Books from Collection
|
|
|
|
Removes multiple books from a collection in a single request.
|
|
|
|
**Method:** POST
|
|
|
|
**Endpoint:** /api/collections/{collection_id}/books/bulk-remove
|
|
|
|
**Authentication:** Bearer token
|
|
|
|
**Path Parameters:**
|
|
- `collection_id` (string): Collection UUID
|
|
|
|
**Request Body:**
|
|
- `book_ids` (array): Array of book UUIDs to remove from the collection
|
|
|
|
**Response:**
|
|
- `removed` (number): Number of books successfully removed
|
|
- `total` (number): Total number of books processed
|
|
- `results` (array): Results for each removal attempt
|
|
- `book_id` (string): Book UUID
|
|
- `success` (boolean): Whether the removal succeeded
|
|
- `error` (string, optional): Error message if failed
|
|
|
|
**Status Codes:**
|
|
- 200: Success (with partial results if some failed)
|
|
- 400: Invalid request data (e.g., empty book_ids array)
|
|
- 401: Unauthorized
|
|
- 403: Forbidden
|
|
- 404: Collection not found
|
|
- 500: Internal server error
|
|
|
|
**Example Request:**
|
|
```json
|
|
{
|
|
"book_ids": [
|
|
"book-uuid-1",
|
|
"book-uuid-2",
|
|
"book-uuid-3"
|
|
]
|
|
}
|
|
```
|
|
|
|
**Example Response:**
|
|
```json
|
|
{
|
|
"removed": 2,
|
|
"total": 3,
|
|
"results": [
|
|
{
|
|
"book_id": "book-uuid-1",
|
|
"success": true
|
|
},
|
|
{
|
|
"book_id": "book-uuid-2",
|
|
"success": true
|
|
},
|
|
{
|
|
"book_id": "book-uuid-3",
|
|
"success": false,
|
|
"error": "Book not in collection"
|
|
}
|
|
]
|
|
}
|
|
```
|
|
|
|
**Note:** Removing a book that's not in the collection returns success: false for that book but doesn't fail the entire request. Empty book_ids array returns 400.
|
|
}
|