latestSwagger 2.02026-08-172560124.6 KB
6863a5956792
reviews
Create a review for a reservation
This resource manages the creation of reviews for a particular agent and a reservation. Reviews must have a description, rating and a reservation public identifier or agent specific reference identifier with reservation agent identifier. The agent must be the one that created the reservation, otherwise it is forbidden.
####Request: The request needs to have 3 parameters for review reviewId, description and rating.
- reservationId: Public ID or agent specific reference id of the reservation where to add a review. Required.
- description: Text content of the review to be set. Optional. A review requires a minimum of a rating.
- rating: Integer value from 1 to 6 with the new rating given. Required.
####Response: The response is a review object containing information about the review.
- reviewId: The Id of the created review.
- status: Status of the created review. Can be 'CREATED', 'PUBLISHED' or 'DENIED'. After a successful creation, 'CREATED' is returned.
- links: A series of links where to get details of the created review;
Example curl:
curl -H "Content-Type: application/json" -X PUT https://{host}/v{X}/reviews/ -d '
{
"reservationId": "07f53b36-3f48-11e5-a151-feff819cdc9f",
"description": "Some description of the review",
"rating": 1
}
curl -H "Content-Type: application/json" -X PUT https://{host}/v{X}/reviews/ -d '
{
"reservationId": "1111112",
"description": "Some description of the review",
"rating": 1,
}
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"
}]
}
put/v1/reviews
Request body
Response
OK