Module: HomeAway::API::Domain::SubmitReview
- Included in:
- Client
- Defined in:
- lib/homeaway/api/domain/submit_review.rb
Instance Method Summary collapse
-
#submit_review(headline, body, locale, arrival_date, rating, listing_id, unit_id, opts = {}) ⇒ Boolean
Creates a review for the given listing and unit.
Instance Method Details
#submit_review(headline, body, locale, arrival_date, rating, listing_id, unit_id, opts = {}) ⇒ Boolean
Note:
user must be logged in via 3 legged oauth to call this function without error
Creates a review for the given listing and unit. The review submitted must go through the standard HomeAway review process and may not appear immediately within the list of reviews for the listing. It is recommended that the link to submitting a review be placed off of the details page of the listing and unit in question.
analogous to calling a POST on API url /public/submitReview
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/homeaway/api/domain/submit_review.rb', line 37 def submit_review(headline, body, locale, arrival_date, , listing_id, unit_id, opts={}) body = { 'headline' => headline.to_s, 'body' => body.to_s, 'locale' => locale.to_s, 'arrivalDate' => HomeAway::API::Util::Validators.date(arrival_date), 'rating' => HomeAway::API::Util::Validators.integer(, 0, 6), 'listingId' => listing_id.to_s, 'unitId' => unit_id.to_s }.merge(HomeAway::API::Util::Validators.query_keys(opts)) begin post '/public/submitReview', body true rescue => e raise e end end |