Community discussions

MikroTik App
 
drudge
just joined
Topic Author
Posts: 4
Joined: Tue Dec 26, 2017 2:44 pm

Login to hotspot using API

Wed Dec 27, 2017 8:52 pm

I am trying to login in mikrtotik hotspot using api with no sucess.

Code: Select all

$this->router->write('/ip/hotspot/active/login',true);
$this->router->write('=user=user',false);
$this->router->write('=password=password',false);
$this->router->write('=mac-address=DC:0B:34:CA:52:C6 ',false);
$this->router->write('=ip=192.168.88.249',false);
$read = $this->router->read(false);
$array = $this->router->parseresponse($read);
var_dump($array)
I am getting the response below:

Code: Select all

<<< [24] /ip/hotspot/active/login
<<< [12] =user=user
<<< [18] =password=password
<<< [30] =mac-address=DC:0B:34:CA:52:C6
<<< [18] =ip=`192.168.88.249`
>>> [5/5] bytes read.
>>> [5, 53]!trap >>> [11/11] bytes read.
>>> [11, 41]=category=4
>>> [32/32] bytes read.
>>> [32, 8]=message=unknown host IP 0.0.0.0
>>> [5/5] bytes read.
>>> [5, 1]!done array(1) { ["!trap"]=> array(1) { [0]=> array(2) { ["category"]=> string(1) "4" ["message"]=> string(23) "unknown host IP 0.0.0.0" } } }
Disconnected...
When i tried to do it from winbox. It is working fine but while trying it from api i am getting the unknown host 0.0.0.0 .
 
mankomal
Member Candidate
Member Candidate
Posts: 106
Joined: Fri Nov 24, 2006 8:56 am

Re: Login to hotspot using API

Sun Aug 25, 2019 8:47 am

Was wondering if you were able to get this done as I am also struck in the same thing.

Who is online

Users browsing this forum: No registered users and 5 guests