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

create users for a specific time #28

Closed WouterSchoofs closed 7 years ago

WouterSchoofs commented 7 years ago

Where can i find an overview of all endpoints from the Unifi API? Do you know if there is an endpoint for creating users for a specific period?

malle-pietje commented 7 years ago

Currently there's no official documentation covering (all) the UniFi controller API endpoints. That being said I believe the API client here is the most extensive one around, partly thanks to all the contribtions from the community.

Second, I don't quite understand what you mean by "creating users for a specific period". Can you elaborate on what you are trying to achieve?

WouterSchoofs commented 7 years ago

Oké thanks for the answer.

Second, i mean with "creating users for a specific period" that if there is a way to create "login accounts" on UniFi where we can say that this account is only useful between 2 sprecified dates.

malle-pietje commented 7 years ago

OK, login accounts for accessing the controller or the wifi network? If it's the network, the only way to implement accounts (user name/password combinations) for wifi access is WPA2-Enterprise with a Radius back-end. That is currently out of scope for the API, at least for the moment.

Or do you mean to authorize a device for guest wifi access between two certain data/times?

If it's for access to the controller, there is no endpoint in the API that supports that.

andymnc commented 7 years ago

i'm sorry, maybe i'm dumb and i didn't quite get it, but... scenario: i open the unifi interface, and create voucher there (from date to date, and probably using "note" to put the room number). Is there any way to do the same through the API? I couldn't find this info anywhere, but, if you look here in unifi forum at the rcourtney post, he says

Keep in mind these fields can be auto filled and then can be modified in your application software before calling the APIs.

As to him, this was possible... What do you think about it?

malle-pietje commented 7 years ago

I see where you're coming from, but there is no feature in the UniFi controller to create a voucher with a start date and end date, only expiration time (I believe this starts at moment of activation): image

All parameters entered in that form can also be applied to a voucher creation request through the API with this function/method: https://github.com/malle-pietje/UniFi-API-browser/blob/master/phpapi/class.unifi.php#L859-L887