PHP code example of alphayax / freebox_api_php

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

    

alphayax / freebox_api_php example snippets


$App = new \alphayax\freebox\utils\Application( 'com.alphayax.freebox.example', 'Freebox PHP API Exemple', '0.0.1');
$App->authorize();
$App->openSession();

$App = new \alphayax\freebox\utils\Application( 'com.alphayax.freebox.version', 'Freebox PHP API Example (Version)', '1.0.0');
$App->setFreeboxApiHost( 'https://xxx.freeboxos.fr:17105'); // A remplacer par votre host
$App->setAppToken( 'xxxxxxxxxxxxxxxxxxxx');                 // A remplacer par votre token
$App->openSession();

$System = new \alphayax\freebox\api\v3\services\config\System( $App);
$SystemConfig = $System->getConfiguration();

print_r( $SystemConfig);

alphayax\freebox\api\v3\models\SystemConfig Object
(
    [firmware_version:protected] => 3.3.1
    [mac:protected] => 77:77:77:77:77:77
    [serial:protected] => 7777777777777777
    [uptime:protected] => 44 jours 16 heures 35 minutes 16 secondes
    [uptime_val:protected] => 3861316
    [board_name:protected] => fbxgw2r
    [temp_cpum:protected] => 63
    [temp_sw:protected] => 52
    [temp_cpub:protected] => 58
    [fan_rpm:protected] => 2253
    [box_authenticated:protected] => 1
)