PHP code example of seromenho / tripadvisor-review-express-api

1. Go to this page and download the library: Download seromenho/tripadvisor-review-express-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

seromenho / tripadvisor-review-express-api example snippets



ReviewExpressApi\ReviewExpressApi;

$review = new ReviewExpressApi("some_key");

$body = array(
    array(
        "recipient"   => "[email protected]",
        "location_id" => "h89575",
        "checkout"    => "2014-12-31",
        "country"     => "US"
    ),
    array(
        "partner_request_id" => "745C6BFF-F0C7-401F-A691-4407F78DC96C",
        "location_id" => "h89575",
        "recipient" => "[email protected]",
        "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();
    }
}