Reviews API
Endpoints for creating and managing book reviews. All endpoints require authentication.
Create or Update Review
Create a new review or update an existing review for a book.
POST /reviews
Authentication
Required (Bearer token)
Rate Limits
- Free tier: 50 reviews per month
- Premium tier: Unlimited
- Bookstore tier: Unlimited
Request Body
{
"bookId": "bb0e8400-e29b-41d4-a716-446655440006",
"rating": 5,
"content": "An absolute masterpiece of modern literature. Salinger's portrayal of teenage angst and alienation is timeless and profoundly moving."
}
Rating Scale
- 1 - Poor
- 2 - Fair
- 3 - Good
- 4 - Very Good
- 5 - Excellent
Response
{
"id": "dd0e8400-e29b-41d4-a716-446655440008",
"userId": "550e8400-e29b-41d4-a716-446655440000",
"user": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"username": "johndoe",
"displayName": "John Doe",
"avatarUrl": "https://cdn.bookwish.app/avatars/johndoe.jpg",
"tier": "premium"
},
"bookId": "bb0e8400-e29b-41d4-a716-446655440006",
"book": {
"id": "bb0e8400-e29b-41d4-a716-446655440006",
"isbn": "9780316769174",
"title": "The Catcher in the Rye",
"authors": ["J.D. Salinger"],
"coverUrl": "https://covers.bookwish.app/9780316769174.jpg"
},
"rating": 5,
"content": "An absolute masterpiece of modern literature. Salinger's portrayal of teenage angst and alienation is timeless and profoundly moving.",
"likeCount": 0,
"isLiked": false,
"createdAt": "2024-03-21T16:00:00Z",
"updatedAt": "2024-03-21T16:00:00Z"
}
Errors
400 ValidationError- Invalid request body (missing rating, invalid rating value)401 Unauthorized- Not authenticated403 Forbidden- Monthly review limit reached (free tier)404 NotFound- Book not found429 TooManyRequests- Rate limit exceeded500 InternalServerError- Server error
Example
curl -X POST "https://api.bookwish.app/reviews" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"bookId": "bb0e8400-e29b-41d4-a716-446655440006",
"rating": 5,
"content": "An absolute masterpiece of modern literature."
}'
Get Review
Get a specific review by ID.
GET /reviews/:id
Authentication
Required (Bearer token)
Path Parameters
id- Review ID