Datasheet
API Ruby class
187
<<< END-OF-SENTENCE
>>> '!trap' (5)
>>> 'message=cannot log in' (21)
>>> '.tag=1' (6)
>>> END-OF SENTENCE
>>> '!done' (5)
>>> '.tag=1' (6)
>>> END-OF SENTENCE
=== LOGIN ERROR: Login failed: cannot log in
user@bsdhost:~$
That run was deliberately with the wrong password. Here's the login with the correct password:
user@bsdhost:~$ tikcli 10.20.30.1 admin correctpassword
<<< '/login' (6)
<<< END-OF-SENTENCE
>>> '!done' (5)
>>> 'ret=857e91c460620a02c3ca72ea7cf6c696' (36)
>>> '.tag=0' (6)
>>> END-OF SENTENCE
<<< '/login' (6)
<<< '=name=admin' (11)
<<< '=response=001a77aec14077ec267c5297969ba1fa24' (44)
<<< END-OF-SENTENCE
>>> '!done' (5)
>>> '.tag=1' (6)
>>> END-OF SENTENCE
Command (/quit to end):
At this point, the interactive client will accept MikroTik API commands in the format /command/name arg1
arg2 arg3 or also 12:/command/name arg1 arg2 arg3 where the 12: is a custom numeric prefix that
tells the Ruby interactive client to auto-cancel the command in question after exactly 12 reply sentences are received,
since otherwise a command with continuous output would hang the single-threaded interactive client in an endless
reply-handling loop (until someone aborted it).
Arguments to API commands in this interactive client must ALREADY be in the API argument form. For example:
Command (/quit to end): /interface/getall ?name=ether1
=== COMMAND: /interface/getall ?name=ether1
<<< '/interface/getall' (17)
<<< '?name=ether1' (12)
<<< END-OF-SENTENCE










