Closed skutylev closed 8 years ago
Can you explain what that API call achieved?
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.
Ok, clear regarding the name. What is the purpose of the email attribute?
I don't know, may be it is optional attribute.
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.
It's good news. Thank You! Where is I can find docs about all functions UniFi API?
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...
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?