unpoller / unifi

Go Library (w/ structures) to grab data from a Ubitquiti UniFi Controller
https://golift.io/discord
MIT License
114 stars 22 forks source link

Add support for new API paths on UDM. #34

Closed davidnewhall closed 4 years ago

davidnewhall commented 4 years ago

This contribution adds support for the new API paths that have shown up on the UniFi Dream Machine. All the paths, with the exception of login, have a new prefix. Login has a new path. To determine which path to use, we perform a request to / when the controller is configured. If that request returns a 200 OK then we assume it's a new controller. The previous controller versions return a 302 redirect to /manage. From that point forward the API paths requested are prefixed with the new prefix if it's a new controller.