Files
bookhoard/bruno/sync-kobo/link-book.bru
T
john-okeefe 3117ce54ec refactor(bruno): migrate API tests to Bruno DSL format
- Convert all existing .bru files from JSON to Bruno DSL format
- Remove obsolete files (conflicts/api.bru, kobo/Kobo Initialization.bru)
- Update auth configuration to use 'inherit' instead of explicit bearer tokens
- Add comprehensive documentation to all test files
- Improve test scripts with proper assertions and error handling
2026-02-08 20:49:06 -05:00

73 lines
1.6 KiB
Plaintext

meta {
name: Link Unlinked Book - Manual Resolution
type: http
seq: 5
}
post {
url: {{base_url}}/api/sync/link-book
body: json
auth: inherit
}
headers {
Authorization: Bearer {{user_token}}
Content-Type: application/json
}
body:json {
{
"unlinked_book_id": "{{unlinked_book_id}}",
"media_item_id": "{{media_item_id}}",
"confidence_score": 1.0
}
}
script:post-response {
function onResponse(res) {
if (res.getStatus() === 200) {
const body = res.getBody();
tests['Status is linked'] = body.status === "linked";
tests('Has unlinked_book_id', body.unlinked_book_id !== undefined);
tests('Has media_item_id', body.media_item_id !== undefined);
tests('Has message', body.message !== undefined);
}
}
onResponse(res);
}
settings {
encodeUrl: true
timeout: 0
}
docs {
## Link Unlinked Book - Manual Resolution
Manually links an unlinked book to a media item in the library.
**Method:** POST
**Endpoint:** /api/sync/link-book
**Authentication:** Bearer token
**Request Body:**
- `unlinked_book_id` (string): Unlinked book UUID
- `media_item_id` (string): Media item UUID to link to
- `confidence_score` (number): Match confidence (0-1, 1.0 for manual)
**Response:**
- `status` (string): Link status (linked)
- `unlinked_book_id` (string): Unlinked book UUID
- `media_item_id` (string): Media item UUID
- `message` (string): Success message
**Status Codes:**
- 200: Success - book linked
- 400: Invalid request
- 401: Unauthorized
- 404: Book or media item not found
- 500: Internal server error
}