Mikrotik API delete hosts

Hello all,

I need some help with api command.
I want to delete specific host from /ip hotspot hosts from a php page.
I only know the mac address for the host.

I can connect with api to my mikrotik but need help with the command for the delete
or anything else i can do.

Any help please..


thanks

With the client from my signature:

$util = new RouterOS\Util($client = new RouterOS\Client('192.168.88.1', 'admin', 'password'));

$util->setMenu('/ip hotspot host')->remove(RouterOS\Query::where('mac-address', '12:34:56:78:90:12'));

Thank you very much..!!

I’ll try it asap

Hi,

I am trying to add/authenticate a device(mac address) using the PEAR2_Net_RouterOS API. Can you please share the details of the arguments that need to be passed or an example?

I have tried the following :

$client->setMenu(‘/ip hotspot active login’)->add(
array(
‘user’ => ‘user1’,
‘ip’ => $_SERVER[‘REMOTE_ADDR’],
‘password’ => ‘password1’,
)
);

Also,

$client->setMenu(‘/ip hotspot host’)->add(
array(
‘user’ => ‘user1’,
‘ip’ => $_SERVER[‘REMOTE_ADDR’],
‘password’ => ‘password1’,
)
);

But I am getting ‘no such command’ error. Please suggest!

Thanks,
Amardeep

Any suggestions, please?

Hi,
I didn’t continue with the project and I don’t have the knowledge to help you .
sorry:)