latestSwagger 2.02026-08-172560124.6 KB

6863a5956792

reviews

Updated a review

This resource manages the update of reviews for a given review ID. Description and rating can be updated on a review. The agent must be the one that owns the reservation associated to the review to modify, otherwise a forbidden response is returned.

NOTE: Reviews in state 'PUBLISHED' or 'DENIED' cannot be updated. Only those in status 'CREATED' are allowed to be updated.

####Request: The request needs to have 3 parameters for reservation reviewId (public reviewId), description and rating.

  • reviewId: Id of the review. Required.
  • description: Text content of the review. If not set (null value) it won't be considered for update.
  • rating: Integer value from 1 to 6 with the rating given. If not set (null value) it won't be considered for update.

In case both description and rating are set to null, nothing happens to the review: it is not updated and its state remains.

####Response: The response is a review object containing information about the review.

  • reviewId: The Id of the updated review.
  • status: Status of the updated review. Can be 'CREATED', 'PUBLISHED' or 'DENIED'. Upon a successful update, the status 'CREATED' is returned.
  • links: A series of links where to get details of the updated review.

Example curl:

curl -H "Content-Type: application/json" -X PATCH https://{host}/v{X}/reviews/ -d '
{
    "reviewId": "01a53b36-3f48-11e5-a151-feff819cdc9f",
    "description": "Some updated description for the review",
    "rating": 2
}

Example response:

{
    "reviewId": "01a53b36-3f48-11e5-a151-feff819cdc9f",
    "status": "CREATED",
    "links": [{
        "href": "http://localhost:39250/v1/reviews/01a53b36-3f48-11e5-a151-feff819cdc9f",
        "method": "GET",
        "rel": "get-review"
    }]
}
patch/v1/reviews

Request body

reviewIdstring uuid required

UUID identifying the review.

ratinginteger

Rating associated to this review. Possible values: 1 to 6.

descriptionstring

Description associated to this review.

Response

OK

reviewIdstring uuid required

Id of to the review.

status'AVAILABLE_TO_REVIEW' | 'CREATED' | 'DENIED' | 'PUBLISHED'

The status of the change.