POST /api/hotels/{hotelId}/reviews

This endpoint allows users to submit a review for a particular hotel identified by the provided hotelId.

Sample request:

POST /hotels/{hotelId}/reviews { "Title": "Amazing Experience", "Description": "The hotel provided exceptional service and comfortable accommodations.", "Rating": 5 }

Path parameters

  • hotelId string(uuid) Required

    The ID of the hotel for which the review is added.

Body

The model containing review details.

  • title string | null

    Title of the review

  • description string | null

    Content of the review (optional)

  • rating integer(int32)

    Rating for the hotel (1-5)

  • Additional properties are NOT allowed

Body

The model containing review details.

  • title string | null

    Title of the review

  • description string | null

    Content of the review (optional)

  • rating integer(int32)

    Rating for the hotel (1-5)

  • Additional properties are NOT allowed

Body

The model containing review details.

  • title string | null

    Title of the review

  • description string | null

    Content of the review (optional)

  • rating integer(int32)

    Rating for the hotel (1-5)

  • Additional properties are NOT allowed

Responses

  • 200

    Success

  • 201

    Review successfully added.

  • 400

    Invalid input or missing required fields.

  • 401

    User is not authenticated.

  • 403

    User is not authorized (not a guest, or didn't visit the hotel).

  • 404

    Hotel with the specified id not found.

POST /api/hotels/{hotelId}/reviews
curl \
 -X POST http://api.example.com/api/hotels/{hotelId}/reviews \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"title":"string","description":"string","rating":42}'
curl \
 -X POST http://api.example.com/api/hotels/{hotelId}/reviews \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: text/json"
curl \
 -X POST http://api.example.com/api/hotels/{hotelId}/reviews \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/*+json"
Request example
{
  "title": "string",
  "description": "string",
  "rating": 42
}
Request examples
{
  "title": "string",
  "description": "string",
  "rating": 42
}
Request examples
{
  "title": "string",
  "description": "string",
  "rating": 42
}