PHP code example of thodinbiz / bubuka-api-for-distributors

1. Go to this page and download the library: Download thodinbiz/bubuka-api-for-distributors 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/ */

    

thodinbiz / bubuka-api-for-distributors example snippets




use Bubuka\Distributors\RestAPI\Exceptions\ApiErrorException;
use Bubuka\Distributors\RestAPI\Exceptions\ResponseException;
use Bubuka\Distributors\RestAPI\ApiClient;

const API_URL = 'http://test.my.bubuka.info/api/dst/';
const TOKEN = '2b3f2d3e2c01a60c234c393214a17133';

// $apiClient = new ApiClient(TOKEN, API_URL);
$apiClient = new ApiClient(TOKEN);

try
{
    $filesList = $apiClient->FilesList();
} catch (ApiErrorException $e)
{
    // Api returned structure of error
} catch (ResponseException $e)
{
    // 500 error, server unavailable, etc.
}

var_dump($filesList);