- Update README.md with interactive rating system details - Document zero-rating behavior in GET /api/ebooks/:id/rating - Add comprehensive rating system documentation section - Update Bruno collection files to reflect new API behavior - Enhance API testing documentation with rating 0 fallback
45 lines
994 B
Plaintext
45 lines
994 B
Plaintext
meta {
|
|
name: Get Ebook Rating
|
|
type: http
|
|
seq: 6
|
|
}
|
|
|
|
get {
|
|
url: http://localhost:8765/api/ebooks/{{ebookid}}/rating
|
|
body: none
|
|
auth: inherit
|
|
}
|
|
|
|
settings {
|
|
encodeUrl: true
|
|
timeout: 0
|
|
}
|
|
|
|
docs {
|
|
## Get Ebook Rating
|
|
|
|
Retrieves the authenticated user's rating for a specific ebook.
|
|
|
|
**Authentication:** Required (Bearer token)
|
|
|
|
**Path Parameters:**
|
|
- `id` (string): Ebook UUID
|
|
|
|
**Response when rating exists:**
|
|
- `id` (string): Rating UUID
|
|
- `ebook_id` (string): Ebook UUID
|
|
- `user_id` (string): User UUID
|
|
- `rating` (number): Rating value (1-5)
|
|
- `created_at` (string): Creation timestamp
|
|
- `updated_at` (string): Last update timestamp
|
|
|
|
**Response when no rating exists:**
|
|
- `ebook_id` (string): Ebook UUID
|
|
- `user_id` (string): User UUID
|
|
- `rating` (number): Always 0 (indicates no rating)
|
|
|
|
**Error Responses:**
|
|
- 401: Invalid authentication
|
|
|
|
**Note:** This endpoint returns HTTP 200 with rating 0 when no rating exists, instead of HTTP 404.
|
|
} |