seromenho/tripadvisor-review-express-api

Wrapper for the Tripadvisor Review Express API.

Installs: 24

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/seromenho/tripadvisor-review-express-api

v1.0 2015-07-08 23:55 UTC

This package is not auto-updated.

Last update: 2025-10-12 00:41:31 UTC


README

Simple PHP Wrapper for the TripAdvisor Review Express API

Installation

You can intall it to your project easily through composer:

$ composer require seromenho/tripadvisor-review-express-api

Usage

<?php
require "./vendor/autoload.php";

use ReviewExpressApi\ReviewExpressApi;

$review = new ReviewExpressApi("some_key");

$body = array(
    array(
        "recipient"   => "john@example.com",
        "location_id" => "h89575",
        "checkout"    => "2014-12-31",
        "country"     => "US"
    ),
    array(
        "partner_request_id" => "745C6BFF-F0C7-401F-A691-4407F78DC96C",
        "location_id" => "h89575",
        "recipient" => "mme.toutlemonde@example.fr",
        "checkin" => "2014-11-07",
        "checkout"=> "2014-11-12",
        "language"=> "fr",
        "country" => "FR"
    )
);

try {
    $response = $review->create($body);
} catch (RequestException $e) {
    echo $e->getRequest();
    if ($e->hasResponse()) {
        echo $e->getResponse();
    }
}