Files
bookhoard/bruno/kobo/markup-sync.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

96 lines
2.4 KiB
Plaintext

meta {
name: Kobo Markup Sync
type: http
seq: 2
}
post {
url: {{base_url}}/api/v1/kobo/markup
body: json
auth: inherit
}
headers {
Authorization: Bearer {{device_token}}
Content-Type: application/json
}
body:json {
{
"ReadingSync": [
{
"ContentId": "kobo_abc123def456",
"PercentRead": 60.0,
"RemainingTimeMin": 120,
"ReadingEvent": "BookRead",
"LastModified": "2026-01-31T12:00:00Z"
}
],
"BookmarkSync": [
{
"BookmarkId": "bookmark_1",
"ContentId": "kobo_abc123def456",
"BookmarkText": "Great quote",
"BookmarkType": "annotation",
"DateCreated": "2026-01-31T12:00:00Z"
}
],
"Metadata": true
}
}
script:post-response {
function onResponse(res) {
if (res.getStatus() === 200) {
const body = res.getBody();
const validStatus = body.Status === "Success" || body.Status === "Partial";
tests('Status is Success or Partial', validStatus);
tests('MarkupsSynced >= 0', body.MarkupsSynced >= 0);
tests('BookmarksSynced >= 0', body.BookmarksSynced >= 0);
}
}
onResponse(res);
}
settings {
encodeUrl: true
timeout: 0
}
docs {
## Kobo Markup Sync
Synchronizes reading progress and markup (highlights, bookmarks) from a Kobo device.
**Method:** POST
**Endpoint:** /api/v1/kobo/markup
**Authentication:** Bearer token (device token)
**Request Body:**
- `ReadingSync` (array, optional): Reading progress data
- `ContentId` (string): Book/content ID
- `PercentRead` (number): Percentage read (0-100)
- `RemainingTimeMin` (number): Remaining time in minutes
- `ReadingEvent` (string): Event type (BookRead, etc.)
- `LastModified` (string): ISO 8601 timestamp
- `BookmarkSync` (array, optional): Bookmark/highlight data
- `BookmarkId` (string): Unique bookmark ID
- `ContentId` (string): Book/content ID
- `BookmarkText` (string): Highlighted/bookmarked text
- `BookmarkType` (string): Type (annotation, bookmark)
- `DateCreated` (string): ISO 8601 timestamp
- `Metadata` (boolean): Whether to include metadata
**Response:**
- `Status` (string): Sync status (Success, Partial)
- `MarkupsSynced` (number): Number of markups synced
- `BookmarksSynced` (number): Number of bookmarks synced
**Status Codes:**
- 200: Success
- 401: Unauthorized
- 500: Internal server error
}