Community discussions

MikroTik App
 
NetMin
just joined
Topic Author
Posts: 1
Joined: Sun Apr 23, 2023 12:24 pm

Mikrotik Router API PHP

Sun Apr 23, 2023 12:36 pm

Dear Members,
I already have a PHP cod that how to reset password by API Class. I need how to get specific user download and upload used in PHP to show below is my code for changing password and in the same context please suggest me a code of download and upload of specific user used in PHP.

My Code for changing password:
require('routeros_api.class.php');

$API = new routeros_api();

$API->debug = true;



if ($API->connect('10.10.0.2', 'user', 'password')) {

$API->write('/tool/user-manager/user/getall', false);
$API->write('=.proplist=username', false);
$API->write('/tool/user-manager/user/set',false);
$API->write('?username=' , $data["EMAIL"]);
$API->write('password=' , $data["vpn_pwd"] );

$READ = $API->read(false);
$ARRAY = $API->parseResponse($READ);
print_r($ARRAY);
$API->disconnect();
}

Change password is working fine we need specific user total download and upload used show via API.

Who is online

Users browsing this forum: jookraw, Wave and 38 guests