Community discussions

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

IP SERVICE SET.... - API PHP

Tue Sep 05, 2017 3:39 pm

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.
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2400
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

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

Tue Sep 05, 2017 3:59 pm

It's "=numbers=ssh", not just "=ssh". Same for all "set" commands in all menus.
 
Jefte
just joined
Topic Author
Posts: 12
Joined: Wed Apr 06, 2016 2:23 pm

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

Tue Sep 05, 2017 4:44 pm

Thx alot man , now works fine...
 
balkhodor
just joined
Posts: 3
Joined: Thu Nov 03, 2016 9:00 am
Location: Beirut lebanon
Contact:

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

Mon Aug 06, 2018 10:31 am

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

Who is online

Users browsing this forum: No registered users and 49 guests