PHP code example of jauhar / router-api

1. Go to this page and download the library: Download jauhar/router-api 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/ */

    

jauhar / router-api example snippets




nologi\RouterApi\Core;

$api = Core::config('{ip_router}', '{username}', '{password}');

$response = $api->query('/interface/print');
print_r($response);




$response = $api->where('/interface/print', [
    '?name' => 'ether1'
]);

print_r($response);

  $api->where('/interface/monitor-traffic', [
    '?interface' => 'ether1',
    '?once' => true
  ]);