PHP code example of ocolin / wisdm

1. Go to this page and download the library: Download ocolin/wisdm 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 / wisdm example snippets


// Manual variables for demonstration
$_ENV['WISDM_API_HOST'] = 'https://wisdm.wirelesscoverage.com/api';
$_ENV['WISDM_API_KEY'] = 'abcdefg';
$wisdm = new Ocolin\Wisdm\Wisdm();

$wisdm = new Ocolin\Wisdm\Wisdm(
    config: new Ocolin\Wisdm\Config(
         host: 'https://wisdm.wirelesscoverage.com/api',
        token: 'abcdefg'
    );
);

// Manual variables for demonstration
$_ENV['WISDM_API_HOST'] = 'https://wisdm.wirelesscoverage.com/api';
$_ENV['WISDM_API_KEY'] = 'abcdefg';
$wisdm = new Ocolin\Wisdm\Wisdm(
    config: new Ocolin\Wisdm\Config( options: [ 'timeout' => 60 ] )
);


$output = $wisdm->get( 
    endpoint: '/availability/{id}/check', query: [ 'id' => 1234 ] 
);

$output = $wisdm->post(
    endpoint: '/networks',
    body: [
        'name'  => 'MySiteName',
        'color' => '#808080'
    ]
);

$output = $widnm->patch(
    endpoint: '/networks/{id}',
    query: [ 'id' => 1234 ],
    body: [ 'name' => 'MyNewSiteName' ]
);

$output = $wisdm->delete(
    endpoint: '/networks/{id}',
    query: [ 'id' => 1234 ]
);

$output = $wisdm->request(
     endpoint: '/availability/{id}/check',
       method: 'GET',
        query: [ 'id' => 1234 ] 
);

$output = $wisdm->upload(
    endpoint: '/networks/import-networks',
    filePath: __DIR__ . '/sites_template.csv',
    body: [
        'colour' => '#808080',
        'site_name_field' => 'Site_Name'
    ]
);