add
Reviews
add
Add Review
This endpoint allows the user to add a new review for a book.
Request Body
book(string): The ID of the book for which the review is being added.review(string): The content of the review.rating(number): The rating given to the book.
Example:
{
"book": "670e16f0d058e963ea3dd770",
"review": "A new review for a great book, ...",
"rating": 5
}
Response
data(object): The response data object.review(object): Details of the added review.book(string): The ID of the book.review(string): The content of the review.reviewer(string): The reviewer’s information.rating(number): The rating given to the book.upvoters(array): List of users who upvoted the review.downvoters(array): List of users who downvoted the review.isRemoved(boolean): Indicates if the review is removed._id(string): The ID of the review.createdAt(string): Timestamp of review creation.updatedAt(string): Timestamp of review update.__v(number): Version number.
error(null): The error message, if any.
Example Response:
{
"data": {
"review": {
"book": "",
"review": "",
"reviewer": "",
"rating": 0,
"upvoters": [],
"downvoters": [],
"isRemoved": true,
"_id": "",
"createdAt": "",
"updatedAt": "",
"__v": 0
}
},
"error": null
}
POST
add