Create Review
This API is used to create a review for an item.
- application/json
Request Body required
- itemId number required
Unique identifier of the item.
- rating number required
The review score out of 5.
- title string required
The title of the review.
- description string
The description of the review.
- image string[] required
The images associated with the review.
Responses
- 201
- 400
Success response
- application/json
- Example
{
"statusCode": 201,
"data": {
"_id": "635785b94ad82b2e8dda009b",
"itemId": 352184,
"rating": 3,
"title": "Best Item!",
"description": "...",
"image": [
"url",
"url"
],
"createdAt": "2022-10-25T06:44:09.702Z"
}
}
Validation error response
- application/json
- Example
{
"statusCode": 400,
"errors": {
"itemId": [
"itemId must be a number conforming to the specified constraints"
],
"rating": [
"rating must be a number conforming to the specified constraints"
],
"title": [
"title must be a string"
],
"description": [
"description must be a string"
],
"image": [
"image must be array of string"
]
},
"message": "Bad Request"
}