$username, 'password' => $password, 'realm' => $realm, 'profile' => $profile, 'cloud_id' => $cloud_id, 'token' => $token, 'active' => 'active', //active flag must be set for user to authenticate /* //Optional Fields 'name' => '', 'surname' => '', 'phone' => '', 'email' => '', 'address' => '', 'from_date' => '04/12/2025', 'to_date' => ''04/12/2026', 'realm_id' => 19, //Alternative to Realm's name 'profile_id' => 49, //Alternative to Profile's name 'static_ip' => '192.168.1.100' 'extra_name' => '', 'extra_value' => '', 'site' => '', 'ppsk' => '', 'auto_add' => 'auto_add' //flag to automatically add the MAC Address the user connects with as a Device (BYOD) belonging to him */ ]; $json_payload = json_encode($payload); $ch = curl_init($api_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $json_payload); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); $response = curl_exec($ch); curl_close($ch); echo "Added $username: $response\n"; ?>