Community discussions

MikroTik App
 
duke
just joined
Topic Author
Posts: 5
Joined: Mon Feb 01, 2010 3:15 pm

why? API delete PPPOE USER fali

Mon Feb 01, 2010 3:25 pm

mikrotik.Send("/ppp/sec/remove");
mikrotik.Send("=name=user1");

fail

mikrotik.Send("/ppp/sec/remove");
mikrotik.Send("=user1");

fail


api Not support?
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 6176
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: why? API delete PPPOE USER fali

Mon Feb 01, 2010 3:30 pm

there is no such submenu as "sec" :D
use full names, api does not support auto completion

correct syntax:
/ppp/secret/remove
=numbers=user1
 
duke
just joined
Topic Author
Posts: 5
Joined: Mon Feb 01, 2010 3:15 pm

Re: why? API delete PPPOE USER fali

Mon Feb 01, 2010 3:38 pm

/ppp/secret/remove
=name=user1

/ppp/secret/remove
=user1

Or failure

Tips are as follows
[color=#FF0000!trap=message=argument error
!done][/color]
 
duke
just joined
Topic Author
Posts: 5
Joined: Mon Feb 01, 2010 3:15 pm

Re: why? API delete PPPOE USER fali

Mon Feb 01, 2010 3:40 pm

OK!!!

=namebers=user1

thanks!!
 
cleciorodrigo
just joined
Posts: 1
Joined: Sun Aug 22, 2010 3:47 pm

Re: why? API delete PPPOE USER fali

Sun Aug 22, 2010 3:49 pm

my friend you could remove users from active connections ?

I'm searching more so far without success
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8511
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: why? API delete PPPOE USER fali

Mon Aug 23, 2010 5:21 pm

my friend you could remove users from active connections ?

I'm searching more so far without success
try like this:
/ppp/active/remove
=.id=my_username
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
inibir
Member Candidate
Member Candidate
Posts: 116
Joined: Thu Nov 25, 2010 2:25 pm
Location: lebanon
Contact:

Re: why? API delete PPPOE USER fali

Thu Oct 06, 2011 4:59 am

	$API->comm("/ppp/secret/set", array(
		".id"	   => "$id"	,
		"profile"  => "$prof"	,
		"comment"  => "$date"	,
		"caller-id"=> ""
	));									     <------Work Normal

	$API->comm("/ppp/active/remove", array(".id"=>"$id"));   <------Not Work  :? 
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6284
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: why? API delete PPPOE USER fali

Thu Oct 06, 2011 9:33 am

check with python API client to see if commands you are using actually work, and then debug your API implementation (it seems in PHP) to make it work correctly.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8511
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: why? API delete PPPOE USER fali

Thu Oct 06, 2011 12:32 pm

seems like you cannot use 'name' as .id in /ppp/active, because 'name' does not identify the item uniquely: there can be many entries with the same 'name' field. so you need to do /ppp/active/print, and then use received .ids to remove actual items
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
User avatar
seriousblack
newbie
Posts: 36
Joined: Tue Apr 03, 2018 4:02 am
Contact:

Re: why? API delete PPPOE USER fali

Sat Jan 02, 2021 5:06 pm

 
 $client = zero_says
 
 $wofBIT=$API->comm("/ppp/active/getall",
                    array(
                           ".proplist"=> ".id",
                                 "?name" => $client,
                              ));
                              
            $API->comm("/ppp/active/remove",
                  array(
                           ".id" => $wofBIT[0][".id"],
                           )
                  );

That works for me
:idea:

Who is online

Users browsing this forum: No registered users and 23 guests