baddah
April 7, 2009, 7:49am
1
Hi,
I’m trying to add a user thorugh the API using PHP. Here is my code. I have tried some variations on this, and can’t seem to get any of them working. (Left out the connect part and so on, this is working fine,its just not adding the user)Any suggestions.
$API->write('/user/add',false);
$API->write('=name=',false);
$API->write('=test=',false);
$API->write('=password=',false);
$API->write('=test0331=',false);
$API->write('=group=',false);
$API->write('=write=');
Thanks
maybe something like
$API->write('/user/add',false);
$API->write('=name=test=',false);
$API->write('=password=test0331=',false);
$API->write('=group=write=');
?..
janisk
April 9, 2009, 5:54am
3
indeed, API command consists of 4 major parts
pat to command is always followed by command
and argument is always followed by value
//
==
eg:
/ip/address/print
=follow=1
where path to command is /ip address/ command is print and follow is argument and 1 is the value of the argument
oops, this command notifies when addresses was added or changed, but it says nothing when address was deleted, unlike ‘/ip/address/listen’. v3.22
p.s. ‘=follow=’ works with any argument. even without an argument =)
janisk
April 16, 2009, 9:49am
5
yes, but it is easier to remember that you have to add something every time, that memorize all the exception where you can omit the value.
Chupaka:
oops, this command notifies when addresses was added or changed, but it says nothing when address was deleted, unlike ‘/ip/address/listen’. v3.22
will that be fixed in 3.23 ?