titravel / api-sdk-php
To Island Travel's PHP SDK for API
Installs: 1 272
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 9
Forks: 0
Open Issues: 0
Requires
- php: >=5.3.0
- ext-json: *
README
This repository contains To Islands Travel's PHP SDK and samples for our API
Prerequisites
- PHP 5.3 or above
- curl extension must be enabled
- json extension must be enabled
- composer for fetching dependencies (See http://getcomposer.org)
Samples
Usage
To write an app that uses the SDK
- add
titravel/api-sdk-php
to yourcomposer.json
require list or copy the sample/composer.json to your project's root - run
composer update --no-dev
to fetch dependencies - obtain API credentials from To Islands Travel
- now you are all set to make your first API call
$apiCredentials = new \TiTravel\Auth\Credentials($config['b2b'], $config['code']); try { $params = array( 'city_id' => null, 'category_id' => null, ); $properties = PropertiesInfo::all($params, $apiCredentials); } catch (Exception $ex) { echo 'Exception:', $ex->getMessage(), PHP_EOL; exit(1); } print_r($properties->toArray());