Update configuration key naming convention to use snake_case consistently. Applies changes recursively across all subdirectories.
87 lines
2.0 KiB
Plaintext
87 lines
2.0 KiB
Plaintext
meta {
|
|
name: Update Universal Progress
|
|
type: http
|
|
seq: 2
|
|
}
|
|
|
|
post {
|
|
url: {{base_url}}/api/progress/{{mediaItemId}}
|
|
body: json
|
|
auth: inherit
|
|
}
|
|
|
|
headers {
|
|
Authorization: Bearer {{jwt}}
|
|
Content-Type: application/json
|
|
}
|
|
|
|
body:json {
|
|
{
|
|
"source": "web",
|
|
"location": {
|
|
"percentage": 0.45,
|
|
"page": 90,
|
|
"total_pages": 200
|
|
},
|
|
"device_metadata": {
|
|
"device_type": "web",
|
|
"user_agent": "integration-test"
|
|
}
|
|
}
|
|
}
|
|
|
|
script:post-response {
|
|
function onResponse(res) {
|
|
if (res.getStatus() === 200) {
|
|
const body = res.getBody();
|
|
tests['Sync status success'] = body.sync_status === "success";
|
|
tests['Progress updated'] = body.progress_updated === true;
|
|
}
|
|
}
|
|
onResponse(res);
|
|
}
|
|
|
|
settings {
|
|
encodeUrl: true
|
|
timeout: 0
|
|
}
|
|
|
|
docs {
|
|
## Update Universal Progress
|
|
|
|
Updates universal reading progress for a media item from a specific device or source.
|
|
|
|
**Method:** POST
|
|
|
|
**Endpoint:** /api/progress/{mediaItemId}
|
|
|
|
**Authentication:** Bearer token
|
|
|
|
**Path Parameters:**
|
|
- `mediaItemId` (string): Media item UUID
|
|
|
|
**Request Body:**
|
|
- `source` (string): Source identifier (web, kobo, koreader, device_id)
|
|
- `location` (object): Progress location data
|
|
- `percentage` (number): Progress percentage (0-1)
|
|
- `page` (number, optional): Current page
|
|
- `total_pages` (number, optional): Total pages
|
|
- `epubcfi` (string, optional): EPUB location
|
|
- `chapter` (number, optional): Current chapter
|
|
- `device_metadata` (object): Device metadata
|
|
- `device_type` (string): Device type
|
|
- `user_agent` (string, optional): User agent string
|
|
|
|
**Response:**
|
|
- `sync_status` (string): Sync status (success, partial)
|
|
- `progress_updated` (boolean): Whether progress was updated
|
|
- `conflicts_detected` (array, optional): Any conflicts detected
|
|
|
|
**Status Codes:**
|
|
- 200: Success
|
|
- 400: Invalid request data
|
|
- 401: Unauthorized
|
|
- 404: Media item not found
|
|
- 500: Internal server error
|
|
}
|