Art-of-WiFi / UniFi-API-browser

Tool to browse data exposed by Ubiquiti's UniFi Controller API
MIT License
1.1k stars 150 forks source link

update-sta #1

Closed skutylev closed 8 years ago

skutylev commented 8 years ago

In old versions Unifi, unifi_sh_api has funcions update-sta i.e.

unifi_update_sta() { if [ $# -lt 1 ] ; then echo "Usage: $0 " exit -1 fi mac=$1 ${curl_cmd} --data "json={'cmd':'update-sta', 'mac':'${mac}', 'name':'$2', 'email':'$3'}" $baseurl/api/cmd/stamgr } Where is this functions in new version? It was deprecated?
malle-pietje commented 8 years ago

Can you explain what that API call achieved?

skutylev commented 8 years ago

It will rename alias user. My script read log of radius server. That log give username and Mac address. Api in old version unifi, allow change alias.

malle-pietje commented 8 years ago

Ok, clear regarding the name. What is the purpose of the email attribute?

skutylev commented 8 years ago

I don't know, may be it is optional attribute.

malle-pietje commented 8 years ago

found how to update a client name and note.... API url: https://<ip address/hostname>:8443/api/s/<siteid>/upd/user/<_id> payload: {name: "device name", note: "device note"}

You can add a method to the phpapi class that calls this url with the specified payload. You will need to have the clients "_id" value as it is part of the API url to call.

skutylev commented 8 years ago

It's good news. Thank You! Where is I can find docs about all functions UniFi API?

malle-pietje commented 8 years ago

There is no documentation other than this file that is bundled with each new release: http://dl.ubnt.com/unifi/4.6.6/unifi_sh_api My suggestion I have analysed by looking at Chromes console when using the Controller interface. There is however, no guarantee that a feature like this one is supported in future releases on the Unifi Controller...