- Convert all JSON tests to JavaScript functions for bruToJsonV2 compatibility
- Update authentication to use 'inherit' instead of manual headers
- Fix hardcoded URLs to use {{base_url}} variables
- Standardize variable syntax from {{ _.var }} to {{var}}
- Add comprehensive API documentation to all requests
- Update environment variables with missing required fields
- Apply consistent structure: meta, http method, headers, tests, vars, settings, docs
- Enhanced validation with proper error handling and field checks
44 lines
980 B
Plaintext
44 lines
980 B
Plaintext
meta {
|
|
name: Get Ebook Ratings
|
|
type: http
|
|
seq: 9
|
|
}
|
|
|
|
get {
|
|
url: {{base_url}}/api/ebooks/{{ebookid}}/ratings
|
|
body: none
|
|
auth: inherit
|
|
}
|
|
|
|
settings {
|
|
encodeUrl: true
|
|
timeout: 0
|
|
}
|
|
|
|
docs {
|
|
## Get Ebook Ratings
|
|
|
|
Retrieves all ratings for a specific ebook, including usernames.
|
|
|
|
**Authentication:** Required (Bearer token)
|
|
|
|
**Path Parameters:**
|
|
- `id` (string): Ebook UUID
|
|
|
|
**Response:** Array of rating objects
|
|
- `id` (string): Rating UUID
|
|
- `ebook_id` (string): Ebook UUID
|
|
- `user_id` (string): User UUID
|
|
- `rating` (number): Rating value (1-10, where odd numbers = half-stars)
|
|
- `created_at` (string): Creation timestamp
|
|
- `updated_at` (string): Last update timestamp
|
|
- `username` (string): Username of the rating user
|
|
|
|
**Rating Conversion:**
|
|
- Frontend displays: 1-5 stars with half-star precision
|
|
- Backend stores: 1-10 (where 1,3,5,7,9 = half-stars)
|
|
|
|
**Error Responses:**
|
|
- 401: Invalid authentication
|
|
- 404: Ebook not found
|
|
} |