PLS API - IYBA Private Listing System API
Via Composer: Here's what you add to your composer.json file to have src/API.php
automatically imported into your vendors folder:
{
"require": {
"iyba/pls": "dev-master"
}
}
Of course, you'll then need to run composer update
.
use IYBA\PLS\API;
$settings = [
'key' => 'YOUR API KEY' (String, Required), // Example: 'dcabf94ad97d6f09914c8be1a302891520a5964d'
'id' => USER ID (Number, Required), // Example: 56
'endpoint' => 'https://api.iyba.pro' (Optional)
];
$api = new API($settings);
use IYBA\PLS\API;
$settings = [
'key' => 'dcabf94ad97d6f09914c8be1a302891520a5964d',
'id' => 56,
'endpoint' => 'https://api.iyba.pro'
];
$api = new API($settings);
Method: vessel($filters_array)
$api->vessel([
'page' => 1,
'currency' => 'usd',
'price' => '0,1000000'
]);
Optionally get_filters()
method returns complete query string, hence we can rewrite the above call as
$api->vessel($api->get_filters());
Method: vessel(id, $api->get_filters())
$api->vessel(82, 'lang=fr');
Method: charter('filter string')
$api->charter('page=1¤cy=usd&price=0,1000000');
$api->charter($api->get_filters()); // As explained above
Method: charter(id, $this->get_filters())
$api->charter(82, 'lang=fr');
Method: brokerage()
$api->brokerage();
Method: brokerage(id)
$api->brokerage(5);
Method: filters($resource, $filters)
$api->filters('vessel', 'lang=fr&status=On');