Page 1 of 1

How to remove active pppoe user via API

Posted: Fri Jan 21, 2022 11:51 am
by n4yeem
Hi

I am using evilfreelancer/routeros-api-php . I am trying to make a query so that pppoe active user from a mikrotik can get disconnect. I tried many methods with the php query but in debug it shows "NO Such Command". Normally if i type in mikrotik terminal interface pppoe-server remove <pppoe-username> it removes the user. Also i tried ppp active remove numbers= . Both resulted same response ''no such command'

This is the sample query

public function disconnectConnectedUser()
{
$query_ppp_deactive_user = new Query("/interface/pppoe-server/print", ['name', 'pppoe-user01']);
$user = $this->client->query($query_ppp_deactive_user)->read();
$data = $user[0]['.id'];
$deactive_user = new Query("/interface/pppoe-server/remove/numbers=$data");
return $this->client->query($deactive_user)->read();
}

I can get full pppoe active list via API! used many ways including username sessionid. all resulted same response from api"no such command"

What am i doing wrong?

Re: How to remove active pppoe user via API

Posted: Fri Apr 28, 2023 8:37 pm
by wilmanro77
Hi,

Do you found your solution? Bc i have the same issue and documentation is not too much online

thanks