'; /** * device MAC address formatted with colons, e.g. 'de:ad:be:ef:01:23' */ $device_mac = ''; /** * initialize the UniFi API connection class, log in to the controller * (this example assumes you have already assigned the correct values in config.php to the variables used) */ $unifi_connection = new UniFi_API\Client( $controlleruser, $controllerpassword, $controllerurl, $site_id, $controllerversion ); $login = $unifi_connection->login(); /** * Run the actual upgrade */ $results = $unifi_connection->upgrade_device($device_mac); /** * provide feedback in json format from $response given by upgrade_device(); */ echo json_encode($results, JSON_PRETTY_PRINT);