Hello,
I am using API to generate vouchers for my Hotspot network.
On my Mikrotik hotspot login page, I only have the Field username active.
I need to authenticate users via username ($login) only, the password filed is hidden but I have set a static password to be used by all users.
My question is can I include attribute “password” in my voucher generating API script…?
$voucher = $voucher = array(
‘expired_by’ => ‘valid_date’,
‘location_id’ => ‘0’,
‘partner_id’ => ‘0’,
‘pool_id’ => ‘-1’,
‘prefix’ => ‘FW_’ . rand(1, 10000),
’password’ => ‘MYSTATICPASS’,
‘price’ => rand(1, 100),
‘quantity’ => 1,
‘phone’ => $phone,
‘speed_download’ => rand(100, 2000),
‘speed_upload’ => rand(100, 2000),
‘time_expired_selector’ => ‘minutes’,
‘time_online’ => rand(100, 2000),
‘time_online_selector’ => ‘hours’,
‘traffic_all_total’ => rand(1000, 5000),
‘traffic_in_total’ => rand(1000, 5000),
‘traffic_out_total’ => rand(1000, 5000),
‘valid_till’ => date(‘Y-m-d’, time() + rand(1000, 10000000))
);
I tried running the above code but, the password attribute doesn’t get submitted… instead I have an auto generated password.
Kindly assist if this is possible…
Many thanks