UNIFI workflows

The API examples are written to be run using a jupyter notebook, these can be downloaded onto your local pc and run using your credentials.

Your credentials are saved in a local config file and then accessed by the notebook. An environment variable containing the path to the config file has to be set up. The notebook can then load the credentials from the config file and use them to run the notebook.

Create an environment variable called ‘waters_connect_settings’ which contains the path to the config file.

Example: waters_connect_settings – ‘c:watersapiapiconfig.txt’

Set the values in the config file, these values should correspond to a registered client which can be set up using the Application Registration Tool

Example of config file:

{ “BaseAddress”: “https://yourserver:48505/unifi/v1/”, “TokenAddress”: “https://yourserver:48333/connect/token”, “ClientId”: “yourId”, “ClientSecret”: “yourSecret”, “UserName”: “username”, “Password”: “password”, “Scope”: “webapi” }

The example uses the default port for the UNIFI API. If the default port has been changed during installation then then new port number needs to be used. Also, there are different default ports for the UNIFI and waters_connect APIs, 48505 and 48444 respectively.

Python and .NET examples available, the appropriate kernel will have to be installed on your local pc to run the examples.