PHP code example of blacksenator / fritzsoap

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

    

blacksenator / fritzsoap example snippets


$fritzbox = new x_contact($url, $user, $password);
$callList = $fritzbox->getCallList();

/**
 * setSwitch
 *
 * automatically generated; complete coding if necessary!
 *
 * in: NewAIN (string)
 * in: NewSwitchState (string)
 *
 * @param string $aIN
 * @param string $switchState
 * @return void
 */
public function setSwitch($aIN, $switchState)
{
    $result = $this->client->SetSwitch(
        new \SoapParam($aIN, 'NewAIN'),
        new \SoapParam($switchState, 'NewSwitchState'));
    $this->errorHandling($result, 'Could not ... from/to FRITZ!Box');
}

 * @see: https://avm.de/fileadmin/user_upload/Global/Service/Schnittstellen/*.pdf

     * ACTION IS NOT IN THE FILE ABOVE DOCUMENTED!



use blacksenator\fritzsoap\x_contact;

$fritzbox = new x_contact;  // no credentials needed in this particular case!
$services = $fritzbox->getServiceDescription();
$services->asXML('services.xml');

$fritzbox = new hosts($url, $user, $password);
$meshList = $fritzbox->getMeshList();

$fritzbox = new x_voip($url, $user, $password);
$fritzbox->x_AVM_DE_DialNumber('030399760');

SOAP_EXCEPTIONS = false,
...
'exceptions' => self::SOAP_EXCEPTIONS,

if ($this->errorHandling($result, 'Could not ... from/to FRITZ!Box')) {

if (is_soap_fault($result)) {