how can get hotspot host traffic by api

how can get hotspot host and active traffic by api in java or php
i want list like this

user tx => traffic rx => traffic

any one can help me :open_mouth: :open_mouth:

I’m not sure I get what you’re asking…

How would you “manually” do what you want from the command line or Winbox? Where it is visible from when not using the API?

thanks for replay i want get it in php page i want show hosts rx and tx in web page using php how can i make it
and anther question when i make connect to mikrotik after page is loading i see in log user log in and log out i want keep connect open how can i do this in php sorry for languish :smiley: :smiley:

and anther question when i make connect to mikrotik after page is loading i see in log user log in and log out i want keep connect open how can i do this in

You need to store the router’s username and password on first HTTP request, and resupply them on further HTTP requests. You can do that with either sessions or HTTP authentication.

Instead of reconnecting on every HTTP request, you can reuse a connection by using pesistent connections, but to actually “target” the old connection, you must still store the username and password, same way as if you’re not using those.

get it in php page i want show hosts rx and tx in web page using php how can i make it

Errrr…

Maybe

$response = $client(new RouterOS\Request('/ip hotspot host print detail=""'));
echo "RX: " . $response('rx-rate') . "\n";
echo "TX: " . $response('tx-rate') . "\n"; 

?

I still don’t know if that’s what you’re after, or even if the above would work… Thought it should (judging from Winbox… I’m not using Hotspot…).