Community discussions

MikroTik App
 
Thamer
just joined
Topic Author
Posts: 20
Joined: Sun Oct 05, 2008 8:46 am

How do i print without details using API ?

Sun Mar 14, 2010 2:24 pm

hi guys

I use this comment to print out the profiles with details in my MT
mikrotik.Send("/ip/hotspot/user/profile/print", True)
but i want print just the profile name without details .

Thanks
 
Muqatil
Trainer
Trainer
Posts: 573
Joined: Mon Mar 03, 2008 1:03 pm
Location: London - UK
Contact:

Re: How do i print without details using API ?

Sun Mar 14, 2010 9:12 pm

use proplist to filter your results.
I suggest to use it always to make the response lighter on every api request.
 
Thamer
just joined
Topic Author
Posts: 20
Joined: Sun Oct 05, 2008 8:46 am

Re: How do i print without details using API ?

Mon Mar 15, 2010 1:23 am

use proplist to filter your results.
I suggest to use it always to make the response lighter on every api request.
thanks Medianet for replay
can you give me example ? because I've used this code but not working :(
        mikrotik.Send("/ip/hotspot/user/profile/print", False)
        mikrotik.Send("=.proplist=.id", False)
thanks a lot ..
 
Muqatil
Trainer
Trainer
Posts: 573
Joined: Mon Mar 03, 2008 1:03 pm
Location: London - UK
Contact:

Re: How do i print without details using API ?

Mon Mar 15, 2010 10:35 am

        mikrotik.Send("/ip/hotspot/user/profile/print", False)
        mikrotik.Send("=.proplist=.id", False)
.id is only a id number of what are you looking for, used in api itself. You might need to add to the proplist the "name" field
        mikrotik.Send("/ip/hotspot/user/profile/print", False)
        mikrotik.Send("=.proplist=.id,name", True)
 
Thamer
just joined
Topic Author
Posts: 20
Joined: Sun Oct 05, 2008 8:46 am

Re: How do i print without details using API ?

Mon Mar 15, 2010 4:49 pm

.id is only a id number of what are you looking for, used in api itself. You might need to add to the proplist the "name" field
        mikrotik.Send("/ip/hotspot/user/profile/print", False)
        mikrotik.Send("=.proplist=.id,name", True)
the result is :(
!trap=message=no such command prefix!done
thanks for help
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7198
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: How do i print without details using API ?

Mon Mar 15, 2010 5:10 pm

Which version is installed? If I remember correctly proplists and queries were added in 3.21
 
Thamer
just joined
Topic Author
Posts: 20
Joined: Sun Oct 05, 2008 8:46 am

Re: How do i print without details using API ?

Mon Mar 15, 2010 7:42 pm

Which version is installed? If I remember correctly proplists and queries were added in 3.21
version 3.30
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: How do i print without details using API ?

Tue Mar 16, 2010 3:08 am

seems like wrong usage of second argument (", False)"). what programming language do you use?
 
Thamer
just joined
Topic Author
Posts: 20
Joined: Sun Oct 05, 2008 8:46 am

Re: How do i print without details using API ?

Tue Mar 16, 2010 2:49 pm

seems like wrong usage of second argument (", False)"). what programming language do you use?
hi Chupaka
i use vb.net

thanks
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: How do i print without details using API ?

Wed Mar 17, 2010 12:00 am

huh, I cannot find VB.Net implementation at http://wiki.mikrotik.com/wiki/API#API_e ... n_the_Wiki

in general, seems like you send "=.proplist=.id,name" as separate command...
 
Thamer
just joined
Topic Author
Posts: 20
Joined: Sun Oct 05, 2008 8:46 am

Re: How do i print without details using API ?

Wed Mar 17, 2010 1:52 am

huh, I cannot find VB.Net implementation at http://wiki.mikrotik.com/wiki/API#API_e ... n_the_Wiki

in general, seems like you send "=.proplist=.id,name" as separate command...
this code is working :)
        mikrotik.Send("/ip/hotspot/user/profile/print")
        mikrotik.Send("=.proplist=name", True)
without writing any parameter in the first line

thanks ..
 
mrzeroo
just joined
Posts: 2
Joined: Tue Sep 01, 2015 4:39 pm

Re: How do i print without details using API ?

Wed May 03, 2017 5:53 pm

In PHP if you want to use more than two commands use False parameter in each write function to wait for the next command as in this
$API->write('/queue/simple/print',false);
$API->write('=.proplist=.id,name',false);
$API->write('=stats=');
$ARRAY = $API->read();
print_r($ARRAY);

If we set it to boolean true, the funcion will send the comand and finish
If we set it to boolean false, the funcion will send the comand and wait for next command
Default: true