Community discussions

MikroTik App
 
Jefte
just joined
Topic Author
Posts: 12
Joined: Wed Apr 06, 2016 2:23 pm

API - PHP

Fri Aug 11, 2017 4:40 pm

Hello guys , i have this command -> /interface wireless access-list print count-only where interface=wlan2 ... and this work fine in command line.
but i try do this in API with lib php.

$API->write('/interface/wireles/access-list/print',false);
$API->write('=count-only=',false);
$API->write('=where=',false);
$API->write('=interface=wlan2');

returning this error -> array(1) { ["!trap"]=> array(1) { [0]=> array(1) { ["message"]=> string(17) "unknown parameter" } } }

anyone can help ? Sorry about my english.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7192
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: API - PHP  [SOLVED]

Fri Aug 11, 2017 4:57 pm

What you are trying to do is not possible. Use queries instead
https://wiki.mikrotik.com/wiki/Manual:API#Queries
 
Jefte
just joined
Topic Author
Posts: 12
Joined: Wed Apr 06, 2016 2:23 pm

Re: API - PHP

Fri Aug 11, 2017 7:04 pm

Thanks ,

$API->write('/interface/wireles/access-list/print',false);
$API->write('=count-only=',false);
$API->write('=where=',false);
$API->write("?interface=$wlan");

Now , works so fine.

Who is online

Users browsing this forum: almdandi, CGGXANNX and 49 guests