Files
bookhoard/bruno/sync-koreader/api.bru
T
john-okeefe 96825e3bc2 Rename API test collection references: Bookmann → Bookhoard
Bruno API test updates:
- Update test assertions: X-Bookmann-* → X-Bookhoard-*
- Update variable names and references in test scripts
- Update documentation and comments in API tests

This is part 4 of the project rename to Bookhoard.
2026-02-01 16:12:05 -05:00

277 lines
6.4 KiB
Plaintext

meta {
name: "Bookhoard KOReader Sync API"
type: "collection"
environment: {
development: {
base_url: "http://localhost:8765/api"
},
production: {
base_url: "https://your-domain.com/api"
}
}
}
# Authentication Headers
@name("KOReader Device Token")
@AuthorizationHeader({
name: "Authorization",
value: "Bearer {{koreader_device_token}}"
})
{
"token": "{{koreader_device_token}}"
}
# Sync Progress
@name("Sync Progress - Single Book")
POST {{environment.base_url}}/sync/koreader/progress
Authorization: Bearer {{koreader_device_token}}
Content-Type: application/json
{
"library_id": "optional-library-uuid",
"books": [
{
"uuid": "book-uuid-here",
"title": "Book Title",
"authors": ["Author Name"],
"progress": 0.45,
"percentage": 0.45,
"last_read": "2026-01-30T20:00:00Z",
"chapter": 3,
"epubcfi": "epubcfi(/6/4/2:15)",
"character": 15432
}
]
}
@name("Sync Progress - Multiple Books")
POST {{environment.base_url}}/sync/koreader/progress
Authorization: Bearer {{koreader_device_token}}
Content-Type: application/json
{
"library_id": "optional-library-uuid",
"books": [
{
"uuid": "book-1-uuid",
"title": "Book One",
"authors": ["Author One"],
"progress": 0.25,
"percentage": 0.25,
"last_read": "2026-01-30T19:00:00Z",
"chapter": 1,
"epubcfi": "epubcfi(/6/4/2:10)"
},
{
"uuid": "book-2-uuid",
"title": "Book Two",
"authors": ["Author Two"],
"progress": 0.75,
"percentage": 0.75,
"last_read": "2026-01-30T20:00:00Z",
"chapter": 8,
"epubcfi": "epubcfi(/6/4/2:50)"
}
]
}
@name("Sync Progress - With Bookmarks")
POST {{environment.base_url}}/sync/koreader/progress
Authorization: Bearer {{koreader_device_token}}
Content-Type: application/json
{
"library_id": "optional-library-uuid",
"books": [
{
"uuid": "book-uuid-here",
"title": "Book Title",
"authors": ["Author Name"],
"progress": 0.45,
"percentage": 0.45,
"last_read": "2026-01-30T20:00:00Z",
"bookmarks": [
{
"chapter": 3,
"datetime": "2026-01-30T19:55:00Z",
"notes": "highlighted text",
"pos0": "epubcfi(/6/4/2:15)",
"pos1": "epubcfi(/6/4/2:20)",
"page": 45,
"text": "highlighted text excerpt",
"type": "highlight"
}
]
}
]
}
@name("Sync Progress - With Highlights and Notes")
POST {{environment.base_url}}/sync/koreader/progress
Authorization: Bearer {{koreader_device_token}}
Content-Type: application/json
{
"library_id": "optional-library-uuid",
"books": [
{
"uuid": "book-uuid-here",
"title": "Book Title",
"authors": ["Author Name"],
"progress": 0.60,
"percentage": 0.60,
"last_read": "2026-01-30T20:00:00Z",
"highlights": [
{
"datetime": "2026-01-30T19:50:00Z",
"text": "Important passage",
"chapter": 4,
"pos0": "epubcfi(/6/4/2:20)",
"pos1": "epubcfi(/6/4/2:30)",
"page_start": 78,
"page_end": 79
}
],
"notes": [
{
"datetime": "2026-01-30T19:52:00Z",
"text": "My note about this chapter",
"chapter": 4
}
]
}
]
}
# Get Metadata
@name("Get Book Metadata")
GET {{environment.base_url}}/sync/koreader/metadata/{{book_uuid}}
Authorization: Bearer {{koreader_device_token}}
@name("Get Metadata for Multiple Books")
GET {{environment.base_url}}/sync/koreader/metadata
Authorization: Bearer {{koreader_device_token}}
Content-Type: application/json
{
"books": ["book-uuid-1", "book-uuid-2", "book-uuid-3"]
}
# Sync Bookmarks
@name("Sync Bookmarks")
POST {{environment.base_url}}/sync/koreader/bookmarks
Authorization: Bearer {{koreader_device_token}}
Content-Type: application/json
{
"library_id": "optional-library-uuid",
"books": [
{
"uuid": "book-uuid",
"bookmarks": [
{
"chapter": 3,
"datetime": "2026-01-30T19:55:00Z",
"notes": "Marked this chapter as important",
"pos0": "epubcfi(/6/4/2:15)",
"pos1": "epubcfi(/6/4/2:20)",
"page": 45,
"text": "Important passage",
"type": "bookmark"
}
]
}
]
}
@name("Sync Highlights")
POST {{environment.base_url}}/sync/koreader/highlights
Authorization: Bearer {{koreader_device_token}}
Content-Type: application/json
{
"library_id": "optional-library-uuid",
"books": [
{
"uuid": "book-uuid",
"highlights": [
{
"datetime": "2026-01-30T19:50:00Z",
"text": "Important quote from book",
"chapter": 4,
"pos0": "epubcfi(/6/4/2:20)",
"pos1": "epubcfi(/6/4/2:30)",
"page_start": 78,
"page_end": 79
}
]
}
]
}
@name("Sync Notes")
POST {{environment.base_url}}/sync/koreader/notes
Authorization: Bearer {{koreader_device_token}}
Content-Type: application/json
{
"library_id": "optional-library-uuid",
"books": [
{
"uuid": "book-uuid",
"notes": [
{
"datetime": "2026-01-30T19:52:00Z",
"text": "My personal note about this chapter",
"chapter": 4
}
]
}
]
}
# Get Library
@name("Get User Library for KOReader")
GET {{environment.base_url}}/sync/koreader/library
Authorization: Bearer {{koreader_device_token}}
@name("Get Library for Specific Book")
GET {{environment.base_url}}/sync/koreader/library
Authorization: Bearer {{koreader_device_token}}
Content-Type: application/json
{
"books": ["book-uuid-1", "book-uuid-2"]
}
# Immediate Sync Mode
@name("Immediate Sync - Page Turn")
POST {{environment.base_url}}/sync/koreader/progress
Authorization: Bearer {{koreader_device_token}}
Content-Type: application/json
{
"sync_mode": "immediate",
"books": [
{
"uuid": "book-uuid",
"percentage": 0.45678,
"chapter": 3,
"timestamp": "2026-01-30T20:00:00Z"
}
]
}
# Checkpoint Sync Mode
@name("Checkpoint Sync")
POST {{environment.base_url}}/sync/koreader/progress
Authorization: Bearer {{koreader_device_token}}
Content-Type: application/json
{
"sync_mode": "checkpoint",
"checkpoint_id": "checkpoint-uuid",
"since_timestamp": "2026-01-30T19:00:00Z",
"books": [
{
"uuid": "book-uuid-1",
"percentage": 0.45,
"chapter": 3
},
{
"uuid": "book-uuid-2",
"percentage": 0.75,
"chapter": 8
}
]
}