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

69 lines
1.5 KiB
Plaintext

meta {
name: Get Progress History
type: http
seq: 3
}
get {
url: {{baseUrl}}/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
}