latestSwagger 2.02026-08-172560124.6 KB

6863a5956792

reviews

Get information from reviews in a list

This resource return a list of reviews. The result obtained depends on the different query parameters provided. It is able to return three different results:

  • Reviews associated to an agent: if neither 'merchantId' nor 'reservationId' query parameters are provided, then the available reviews for the current agent are returned.
  • Reviews associated to a merchant: if the parameter 'merchantId' is provided, all the reviews for the given merchant and agent are provided. The agent is the one associated with the reservations.
  • Reviews associated to a reservation: Reservation could be identified in two ways: either by reservation public id or by agent reservation reference id.

NOTE: For the second and third cases, the current agent must be the owner of the reservations used to get the reviews. In the specific case of the search by the merchants, the current agent id is the one realated to the reservations associated to the specified merchant's reviews.

####Request: The request needs 4 optional query parameters. Pagination is controlled by the usage of the 'limit' and 'offset' parameters.

  • limit: maximum number of results to be returned. Value must be between 1 and 10. Defaults to 10 when unset, malformed or outside bounds. Ignored when 'reservationId' is enabled.
  • offset: sets the starting element to be returned. Defaults to 0 when unset or malformed. Ignored when 'reservationId' is enabled.
  • reservationId: Either public ID of the reservation or agent reservation reference id from which to get the reviews. Cannot be used in combination with 'merchantId'. Can be null. Does not consider 'limit' and/or 'offset'.
  • merchantId: ID of the merchant from which to get the reviews. Cannot be used in combination with 'reservationId'. Can be null.

####Response: The response is a user review object containing a list of user reviews.

  • size: the number of reviews retrieved in this request. Can be any positive value between 0 and 10 (the maximum value for limit);

  • offset: echoes the offset value used in the request. Returns 0 in case 'reservationId' is used.

  • limit: echoes the limit value used in the request. Returns 0 in case 'reservationId' is used.

  • reviews: list of reviews retrieved, each review containing the following properties:

  • reviewId: review UUID. Same as the one used in the request.

  • rating: rating associated to this review.

  • description: description of the review.

  • status: current review status. Possible values are 'CREATED', 'DENIED', 'PUBLISHED'.

  • merchantId: merchant id associated to this review. Only in the detailed view.

  • customerId: customer id associated to this review. DEPPRECATED, NOT USED.

  • publicCustomerId: public customer id associated to this review. Only in the detailed view.

  • customerFirstName: review associated customer first name. Only in the detailed view.

  • customerLastName: first character of the customer last name. Only in the detailed view.

  • customerProfileImage: customer profile image URL. Only in the detailed view.

  • locale: locale associated to the review. Only in the detailed view.

  • reservationId: the reservation identifier this review is created for. Either reservation public id or agent specific reservation reference id(if set on creation) is used

  • createdAt: the date and time the review created at.

Example curl:

curl https://{host}/v{X}/reviews?merchantId=5124

Example response:

{
	"reviews": [{
			"reviewId": "e94c5f9b-e61f-486a-bfa7-48abb1e42f93",
			"merchantId": 5124,
			"publicCustomerId": "a10fbb9a-df04-407c-9568-2e79bd620b41",
			"customerFirstName": "Perico",
			"customerLastName": "d",
			"customerProfileImage": "http://test.bla",
			"rating": 6,
			"description": "Description 8",
			"status": "PUBLISHED",
			"locale": "de_DE",
            "reservationId":"1111112",
            "createdAt":"2020-07-28T09:45:33Z"
		}, {
			"reviewId": "65472403-7968-4ccf-b389-fe7e6e70ee27",
			"merchantId": 5124,
			"publicCustomerId": "a10fbb9a-df04-407c-9568-2e79bd620b41",
			"customerFirstName": "Perico",
			"customerLastName": "d",
			"customerProfileImage": "http://test.bla",
			"rating": 6,
			"description": "Description 9",
			"status": "PUBLISHED",
			"locale": "de_DE",
            "reservationId":"7dbe05dc-f566-48be-9872-c77b71aff072",
            "createdAt":"2020-07-28T09:45:54Z"
		}
	],
	"size": 2,
	"offset": 0,
	"limit": 10
}
get/v1/reviews

Query parameters

merchantIdinteger

MerchantId to get the reviews from. Cannot be used in combination with 'reservationId'

reservationIdstring

Reservation id to get the reviews from. Either public id or agent reference id. Cannot be used in combination with 'merchantId'. When set, 'offset' and 'limit' are ignored. All reviews for a reservation are returned.

offsetinteger

Skip first n reviews

limitinteger

Max number to retrieve

Response

Review response

sizeinteger

Number of reviews returned in this object.

offsetinteger

Offset to apply on the next pagination request. Can be higher than the number of available reviews.

limitinteger

Expected number of reviews that could be retrieved in the next pagination request. Can actually be less than the number returned. Its value is 0 when it is sure there are no more reviews available for pagination using the 'offset' as starting point.