Skip to content

Latest commit

 

History

History
112 lines (75 loc) · 1.98 KB

README.md

File metadata and controls

112 lines (75 loc) · 1.98 KB

IYBA Private Listing API - PHP Library

PLS API - IYBA Private Listing System API

Installation

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.

How to use

Instantiate API class

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);

Example

use IYBA\PLS\API;
    
$settings = [
    'key' => 'dcabf94ad97d6f09914c8be1a302891520a5964d',
    'id' => 56,
    'endpoint' => 'https://api.iyba.pro'
];
    
$api = new API($settings);

Filter vessels

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());

Fetch vessel using it's ID and language filter

Method: vessel(id, $api->get_filters())

$api->vessel(82, 'lang=fr');

Filter charter vessels

Method: charter('filter string')

$api->charter('page=1&currency=usd&price=0,1000000');
$api->charter($api->get_filters()); // As explained above

Fetch charter details using vessel ID and language filter

Method: charter(id, $this->get_filters())

$api->charter(82, 'lang=fr');

Fetch brokerage details (Yours)

Method: brokerage()

$api->brokerage();

Fetch brokerage by it's ID

Method: brokerage(id)

$api->brokerage(5);

Vessel and Charter filters

Method: filters($resource, $filters)

$api->filters('vessel', 'lang=fr&status=On');