Files
bookhoard/bruno/koreader/Sync Bookmarks.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

113 lines
2.5 KiB
Plaintext

meta {
name: KOReader Sync Bookmarks
type: http
seq: 4
}
post {
url: {{base_url}}/api/sync/koreader/bookmarks
body: json
auth: inherit
}
headers {
Authorization: Bearer {{device_token}}
Content-Type: application/json
}
body:json {
{
"book_uuid": "{{book_uuid}}",
"bookmarks": [
{
"chapter": 3,
"datetime": "2026-01-30T19:55:00Z",
"notes": "Bookmarked text",
"pos0": "epubcfi(/6/4/2:15)",
"pos1": "epubcfi(/6/4/2:20)",
"page": 45,
"text": "This is important",
"type": "highlight",
"percentage": 0.45
}
],
"notes": [
{
"chapter": 3,
"datetime": "2026-01-30T19:55:00Z",
"notes": "My note here",
"pos0": "epubcfi(/6/4/2:15)",
"page": 45,
"text": "Note content",
"type": "note"
}
],
"highlights": [
{
"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",
"color": "#ffff00",
"percentage": 0.45
}
]
}
}
script:post-response {
function onResponse(res) {
if (res.getStatus() === 200) {
const body = res.getBody();
tests['Sync completed'] = body.sync_status === "completed";
tests('Items synced >= 0', body.total_synced >= 0);
}
}
onResponse(res);
}
settings {
encodeUrl: true
timeout: 0
}
docs {
## KOReader Sync Bookmarks
Synchronizes bookmarks, notes, and highlights from a KOReader device.
**Method:** POST
**Endpoint:** /api/sync/koreader/bookmarks
**Authentication:** Bearer token (device token)
**Request Body:**
- `book_uuid` (string): Book UUID
- `bookmarks` (array): Array of bookmark objects
- `notes` (array): Array of note objects
- `highlights` (array): Array of highlight objects
Each object includes:
- `chapter` (number): Chapter number
- `datetime` (string): ISO 8601 timestamp
- `text` (string): Highlighted/bookmarked text
- `pos0`, `pos1` (string): EPUB CFI positions
- `page` (number): Page number
- `type` (string): Type (highlight, bookmark, note)
- `percentage` (number): Position in book (0-1)
**Response:**
- `sync_status` (string): Sync status (completed, partial)
- `total_synced` (number): Number of items synced
**Status Codes:**
- 200: Success
- 401: Unauthorized
- 500: Internal server error
}