Change hotspot password with PHP API

Hi,

I´m from Brazil and my english is poor. I need help to translate command CLI to API PHP.

Anybody know?

I intent do this:

require(‘routeros_api.class.php’);

$API = new routeros_api();

$API->debug = true;


$ip = ‘xxx.xxx.xxx.xxx’;
$usuario = ‘admin’;
$senha = ‘’;


if ($API->connect($ip, $usuario, $senha))
{
$API->write(‘/user/set’,false);
$API->write(‘=name=teste3’,false);
}



But it doesn´t work:

I look in winBox in ‘use list’ panel and the name is the same. I try connect with new user e can´t login.

I don´t know what happening. I read API PHP, API mikrotik, looking in google and now i´m so tired.

Thank you for any help.