'; /** * site where the above MAC address is connected */ $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 force the device to reconnect */ $reconnect_result = $unifi_connection->reconnect_sta($mac_to_reconnect); /** * provide feedback in json format */ echo json_encode($reconnect_result, JSON_PRETTY_PRINT);