/fareharbor-php

generated openapi php fareharbor api client

Primary LanguagePHP

SwaggerClient-php

This is a simple API

This PHP package is automatically generated by the Swagger Codegen project:

  • API version: 1.0.0
  • Build package: io.swagger.codegen.v3.generators.php.PhpClientCodegen

Requirements

PHP 5.5 and later

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
    }
  ],
  "require": {
    "GIT_USER_ID/GIT_REPO_ID": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/SwaggerClient-php/vendor/autoload.php');

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: apiApp
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-FareHarbor-API-App', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-FareHarbor-API-App', 'Bearer');
// Configure API key authorization: apiUser
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-FareHarbor-API-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-FareHarbor-API-User', 'Bearer');

$apiInstance = new Swagger\Client\Api\BookingApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$company_short_name = "company_short_name_example"; // string | Company short name
$availability_id = 56; // int | Availability id
$body = new \Swagger\Client\Model\Booking(); // \Swagger\Client\Model\Booking | 

try {
    $result = $apiInstance->bookingTour($company_short_name, $availability_id, $body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BookingApi->bookingTour: ', $e->getMessage(), PHP_EOL;
}

// Configure API key authorization: apiApp
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-FareHarbor-API-App', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-FareHarbor-API-App', 'Bearer');
// Configure API key authorization: apiUser
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-FareHarbor-API-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-FareHarbor-API-User', 'Bearer');

$apiInstance = new Swagger\Client\Api\BookingApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$company_short_name = "company_short_name_example"; // string | Company short name
$booking_id = "booking_id_example"; // string | Booking id

try {
    $result = $apiInstance->deleteBooking($company_short_name, $booking_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BookingApi->deleteBooking: ', $e->getMessage(), PHP_EOL;
}

// Configure API key authorization: apiApp
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-FareHarbor-API-App', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-FareHarbor-API-App', 'Bearer');
// Configure API key authorization: apiUser
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-FareHarbor-API-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-FareHarbor-API-User', 'Bearer');

$apiInstance = new Swagger\Client\Api\BookingApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$company_short_name = "company_short_name_example"; // string | Company short name
$booking_id = "booking_id_example"; // string | Booking id

try {
    $result = $apiInstance->getBookingDetail($company_short_name, $booking_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BookingApi->getBookingDetail: ', $e->getMessage(), PHP_EOL;
}

// Configure API key authorization: apiApp
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-FareHarbor-API-App', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-FareHarbor-API-App', 'Bearer');
// Configure API key authorization: apiUser
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-FareHarbor-API-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-FareHarbor-API-User', 'Bearer');

$apiInstance = new Swagger\Client\Api\BookingApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$company_short_name = "company_short_name_example"; // string | Company short name
$booking_id = "booking_id_example"; // string | Booking id
$body = new \Swagger\Client\Model\Note(); // \Swagger\Client\Model\Note | 

try {
    $result = $apiInstance->noteBooking($company_short_name, $booking_id, $body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BookingApi->noteBooking: ', $e->getMessage(), PHP_EOL;
}

// Configure API key authorization: apiApp
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-FareHarbor-API-App', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-FareHarbor-API-App', 'Bearer');
// Configure API key authorization: apiUser
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-FareHarbor-API-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-FareHarbor-API-User', 'Bearer');

$apiInstance = new Swagger\Client\Api\BookingApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$company_short_name = "company_short_name_example"; // string | Company short name
$availability_id = 56; // int | Availability id
$body = new \Swagger\Client\Model\Booking(); // \Swagger\Client\Model\Booking | 

try {
    $result = $apiInstance->validateBookingTour($company_short_name, $availability_id, $body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BookingApi->validateBookingTour: ', $e->getMessage(), PHP_EOL;
}
?>

Documentation for API Endpoints

All URIs are relative to https://virtserver.swaggerhub.com/tripup/FareHarbour/1.0.0

Class Method HTTP request Description
BookingApi bookingTour POST /companies/{company-short-name}/availabilities/{availability-id}/bookings/ Booking tour
BookingApi deleteBooking DELETE /companies/{company-short-name}/bookings/{booking-id}/ Cancel a booking
BookingApi getBookingDetail GET /companies/{company-short-name}/bookings/{booking-id}/ Get booking details
BookingApi noteBooking PUT /companies/{company-short-name}/bookings/{booking-id}/note/ Update the booking note
BookingApi validateBookingTour POST /companies/{company-short-name}/availabilities/{availability-id}/bookings/validate/ Validate bookings
CompaniesApi getCompanies GET /companies/ Get companies
ToursApi getCompanyItems GET /companies/{company-short-name}/items/ Get company tours
ToursApi getDetailAvailabilityTour GET /companies/{company-short-name}/availabilities/{availability-id}/ Get availability tour
ToursApi getToursByDateRange GET /companies/{company-short-name}/items/{tour-id}/minimal/availabilities/date-range/{start-date}/{end-date}/ Get company tours by date range
ToursApi getToursOnDate GET /companies/{company-short-name}/items/{tour-id}/minimal/availabilities/date/{date}/ Get tours for date

Documentation For Models

Documentation For Authorization

apiApp

  • Type: API key
  • API key parameter name: X-FareHarbor-API-App
  • Location: HTTP header

apiUser

  • Type: API key
  • API key parameter name: X-FareHarbor-API-User
  • Location: HTTP header

Author

you@your-company.com