PHP code example of ocolin / tarana-tcs

1. Go to this page and download the library: Download ocolin/tarana-tcs 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/ */

    

ocolin / tarana-tcs example snippets


// Manual for demonstration
$_ENV['TARANA_TCS_API_TOKEN'] = 'abcdefg';
$_ENV['TARANA_TCS_API_HOST'] = 'https://api.tcs.taranawireless.com';
$taranaTCS = new Ocolin\TaranaTCS\TaranaTCS();

$taranaTCS = new Ocolin\TaranaTCS\TaranaTCS(
       host: 'https://api.tcs.taranawireless.com',
      token: 'abcdefg'
);

$taranaTcs = new Ocolin\TaranaTCS\TaranaTCS( options: [ 'verify' => false ] );

// End point will be /v2/network/radios/abcdefg
$output = $taranaTCS->get( 
    endpoint: '/v2/network/radios/{serialNumber}',
       query: [ 'serialNumber' => 'abcdefg' ]
);

$output = $taranaTCS->post(
    endpoint: '/v1/network/regions',
        body: [ 'name' => 'RegionName' ]
);

$output = $taranaTCS->patch(
    endpoint: '/v1/network/regions/{regionName}',
       query: [ 'regionName' => 'RegionName' ],
        body: [ 'notes' => 'My new notes' ]
);

$output = $taranaTCS->put(
    endpoint: '/v1/users/{email}',
       query: [ 'email' => '[email protected]' ],
        body: [ ... ]
);

$output = $taranaTCS->delete(
    endpoint: '/v1/users/{email}',
       query: [ 'email' => '[email protected]' ]
);

$output = $taranaTCS->request(
    endpoint: '/v1/network/regions/{regionName}',
      method: 'PATCH',
       query: [ 'regionName' => 'RegionName' ],
        body: [ 'notes' => 'My new notes' ]
);