Page 1 of 1

IP SERVICE SET.... - API PHP

Posted: Tue Sep 05, 2017 3:39 pm
by Jefte
Hello guys , i have this both command -> (( /ip service set address=8.8.8.8 ssh OR -> /ip service set ssh address=8.8.8.8 ) ... and this work fine in command line.
but i try do this in two forms with API lib php.

$API->write('/ip/service/set',false);
$API->write("=address=$ips",false);
$API->write("=ssh="); // $API->write("?ssh=");
$API->read();

$API->write('/ip/service/set',false);
$API->write("=ssh=address=$ips");
$API->read();

anyone can help ? Sorry about my english.

Re: IP SERVICE SET.... - API PHP  [SOLVED]

Posted: Tue Sep 05, 2017 3:59 pm
by boen_robot
It's "=numbers=ssh", not just "=ssh". Same for all "set" commands in all menus.

Re: IP SERVICE SET.... - API PHP

Posted: Tue Sep 05, 2017 4:44 pm
by Jefte
Thx alot man , now works fine...

Re: IP SERVICE SET.... - API PHP

Posted: Mon Aug 06, 2018 10:31 am
by balkhodor
hello guys,

i`m not good enough in coding

what i`m searching for is to enable winbox service via api!

because i disabled it by mistake and i`m unable to login ! and i do not want to reset my machine

any code would help ?

bilal al khodor