UniFi Access
Create an API token
The UniFi Access API token SportyPlus needs, and the permissions to give it
SportyPlus acts on your doors with an API token from UniFi Access. You create it on your console and paste it into Club Admin yourself, so it never has to be sent to anyone.
Create the token
Sign in to your console, at unifi.ui.com or on its local address, and open UniFi Access:
- Open Settings → General → Advanced → API Token, and choose Create New.
- Name it
SportyPlus, so it's obvious in the console's log what it belongs to. - Set the validity as long as you're comfortable with. When the token expires, SportyPlus stops issuing PINs and can't unlock doors until you paste in a new one.
- Select the permissions below, and create the token.
- Copy the token now. UniFi shows it only once.
Permissions
UniFi calls these permission scopes and groups them by area. Select these three:
| Scope | What SportyPlus uses it for |
|---|---|
view:space | reading your doors, so you can match them to courts |
edit:space | unlocking a door when staff press Unlock in Club Admin |
edit:visitor | giving each booked player a visitor with their PIN, and moving it from booking to booking |
A missing permission doesn't show up when you create the token. It shows up later, as the console
refusing a request. If door PINs don't appear, or Unlock fails with refused (403), check
these permissions first.
Give the token nothing else. It doesn't need users, access policies or system settings.
Next
Paste the token into Club Admin: set it up in Club Admin.
If you ever think the token has leaked, delete it in UniFi Access, create a new one and paste that in. The old one stops working immediately.