Files
bookhoard/bruno/koreader/Sync Progress.bru
T
john-okeefe 26070e4000 Refactor: rename baseUrl to base_url in .bru files
Update configuration key naming convention to use snake_case
consistently.
Applies changes recursively across all subdirectories.
2026-02-08 21:26:31 -05:00

99 lines
2.4 KiB
Plaintext

meta {
name: KOReader Sync Progress
type: http
seq: 1
}
post {
url: {{base_url}}/api/sync/koreader/progress
body: json
auth: inherit
}
headers {
Authorization: Bearer {{device_token}}
Content-Type: application/json
}
body:json {
{
"library_id": null,
"books": [
{
"uuid": "{{book_uuid}}",
"title": "Test Book",
"authors": ["Test Author"],
"progress": 0.45,
"percentage": 0.45,
"last_read": "2026-01-30T20:00:00Z",
"chapter": 5,
"character": 15432,
"epubcfi": "epubcfi(/6/4/2:15)",
"page": 89,
"total_pages": 200
}
],
"sync_mode": "immediate",
"device_info": {
"koreader_version": "2024.01",
"device_model": "kindle-paperwhite-5"
}
}
}
script:post-response {
function onResponse(res) {
if (res.getStatus() === 202) {
const body = res.getBody();
tests['Status is 202'] = res.getStatus() === 202;
tests['Sync status accepted'] = body.sync_status === "accepted";
tests('Books synced >= 0', body.books_synced >= 0);
}
}
onResponse(res);
}
settings {
encodeUrl: true
timeout: 0
}
docs {
## KOReader Sync Progress
Synchronizes reading progress from a KOReader device to the Bookhoard server.
**Method:** POST
**Endpoint:** /api/sync/koreader/progress
**Authentication:** Bearer token (device token)
**Request Body:**
- `library_id` (string, optional): Library UUID
- `books` (array): Array of book progress objects
- `uuid` (string): Book UUID
- `title` (string): Book title
- `authors` (array): List of authors
- `progress` (number): Progress value
- `percentage` (number): Percentage complete (0-1)
- `last_read` (string): ISO 8601 timestamp
- `chapter` (number): Current chapter
- `epubcfi` (string): EPUB Canonical Fragment Identifier
- `page` (number): Current page
- `total_pages` (number): Total pages
- `sync_mode` (string): Sync mode (immediate, deferred)
- `device_info` (object): Device information
- `koreader_version` (string): KOReader version
- `device_model` (string): Device model identifier
**Response:**
- `sync_status` (string): Sync status (accepted, processing)
- `books_synced` (number): Number of books synced
**Status Codes:**
- 202: Accepted - sync queued
- 401: Unauthorized
- 500: Internal server error
}