Files
bookhoard/bruno/universal-progress/Get Progress History.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

69 lines
1.5 KiB
Plaintext

meta {
name: Get Progress History
type: http
seq: 3
}
get {
url: {{base_url}}/api/progress/{{mediaItemId}}/history
body: none
auth: inherit
}
headers {
Authorization: Bearer {{jwt}}
Content-Type: application/json
}
script:post-response {
function onResponse(res) {
if (res.getStatus() === 200) {
const body = res.getBody();
tests['Has sessions key'] = body.sessions !== undefined;
}
}
onResponse(res);
}
settings {
encodeUrl: true
timeout: 0
}
docs {
## Get Progress History
Retrieves historical reading progress sessions for a specific media item.
**Method:** GET
**Endpoint:** /api/progress/{mediaItemId}/history
**Authentication:** Bearer token
**Path Parameters:**
- `mediaItemId` (string): Media item UUID
**Query Parameters:**
- `limit` (number, optional): Maximum number of sessions to return
- `offset` (number, optional): Offset for pagination
**Response:**
- `sessions` (array): Array of reading sessions
- `session_id` (string): Session UUID
- `start_time` (string): Session start timestamp
- `end_time` (string): Session end timestamp
- `start_percentage` (number): Progress at start
- `end_percentage` (number): Progress at end
- `device_id` (string): Device used
- `duration_seconds` (number): Session duration
- `total_sessions` (number): Total number of sessions
- `total_reading_time` (number): Total reading time in seconds
**Status Codes:**
- 200: Success
- 401: Unauthorized
- 404: Media item not found
- 500: Internal server error
}