Art-of-WiFi / UniFi-API-client

A PHP API client class to interact with Ubiquiti's UniFi Controller API
MIT License
1.09k stars 217 forks source link

changes in unifi API in 6.2.x #119

Closed kingcin closed 3 years ago

kingcin commented 3 years ago

Hello, api calls apprently changed in controller version 6.2.x (using 6.2.25)

I find out that in orde rto mae script workign correcly in all api calls beside login it is required to add

/proxy/network eg $BASEURL/proxy/network/api/s/$SITE/stat/device

and to login itsealf path is $BASEURL/api/auth/login

and it is also required to add in curl header Content-Type: application/json

kingcin commented 3 years ago

update :) it refers to cloud-key only

malle-pietje commented 3 years ago

Did you actually check what the latest version of the API client does? It should automatically adapt and use the new routes and request headers. https://github.com/Art-of-WiFi/UniFi-API-client/blob/master/src/Client.php#L3804-L3806 https://github.com/Art-of-WiFi/UniFi-API-client/blob/master/src/Client.php#L172-L178

Please check this and report back with more details if you encounter an issue with the latest version of the client class.