'; /** * the site to which the device belongs */ $site_id = ''; /** * initialize the UniFi API connection class and log in to the controller */ $unifi_connection = new UniFi_API\Client($controlleruser, $controllerpassword, $controllerurl, $site_id, $controllerversion); $set_debug_mode = $unifi_connection->set_debug($debug); $loginresults = $unifi_connection->login(); /** * then we disable the device */ $disable_result = $unifi_connection->disable_ap($device_id, true); /** * or we enable the device, uncomment as neccesary (then also comment the previous call) */ //$disable_result = $unifi_connection->disable_ap($device_id, false); /** * provide feedback in json format */ echo json_encode($disable_result, JSON_PRETTY_PRINT);