Problems with API - Help

Expensive Friends of the FORUM,
Already I tried you vary mareiras more I am not obtaining to execute the commands for alterations of the functions of the MIKROTIK type.

system identity set name=test - in the terminal or ssh

in api
/system/identity/set =name=teste, does not function,

if I place

/system/identity/get functions there results giving it of the name.

As I will be able to decide this problem.

I tried to do the same like you tried and my own PHP API class returned “!done”, but didn’t change my identity.
Even though I show you how I did it.

/system/identity/set
=name=teste

It’s important to write it as two commands respectively in two lines (as shown above).
Hope it works :wink:

Debtor for the reply, more also I tried in this way without success, is as if it not enviase the second or third line of script, somebody has some suggestion.
1º test: $API-> write (’ /system/identity/set’); -! done

2º test $API-> write (’ /system/identity/set=name=teste’); they =message=em such command

3º test
$API-> write (’ /system/identity/set’); -! done
$API-> write (’ =name=test’); -! done - more it does not modify in mikrotik.

I am needing same bigger information on the API, that have will have some class in PHP, please to place in the FORUM.

before the command should be length of command converted to byte, please read
http://wiki.mikrotik.com/wiki/API

api->send ( ((byte)20) + “/system/identity/set” + ((byte)10) + “=name=test” );

Hi!
I wrote a PHP class (PHP 5) based on the posted class of “Denis Basta” (see here: http://forum.mikrotik.com/t/api-php-class/22551/1)… And when you do it like shown below, it should work (I tried it and it works fine) - even with the referred class.

$RouterOSAPI->write('/system/identity/set', false);
$RouterOSAPI->write('=name=teste');
$RouterOSAPI->read();