Skip to content

Commit 70da148

Browse files
committed
updated PHP API client to version 2.0.6
1 parent dded3e8 commit 70da148

File tree

9 files changed

+357
-70
lines changed

9 files changed

+357
-70
lines changed

composer.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/art-of-wifi/unifi-api-client/API_REFERENCE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ public function set_site_ntp(string $ntp_id, $payload): bool
435435
Sets the NTP settings for the current site.
436436

437437
**Parameters:**
438-
- `$ntp_id` (string): ID of the NTP settings
438+
- `$ntp_id` (string): _id of the NTP settings
439439
- `$payload` (mixed): NTP configuration data
440440

441441
**Returns:** bool - true upon success
@@ -456,12 +456,12 @@ Sets the connectivity settings for the current site.
456456

457457
### List Networks
458458
```php
459-
public function list_networks(?string $site_id = null): array
459+
public function list_networkconf(?string $network_id = '')
460460
```
461-
Lists all networks or networks for a specific site.
461+
Lists all non-wireless networks for the current site.
462462

463463
**Parameters:**
464-
- `$site_id` (string|null): Site ID to use (default: current site)
464+
- `$network_id` (string|null): _id value of the network to get settings for
465465

466466
**Returns:** array - Array of network objects
467467

vendor/art-of-wifi/unifi-api-client/README.md

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ easy inclusion in your projects. See the [installation instructions](#Installati
1616

1717
## Supported Versions
1818

19-
| Software | Versions |
20-
|--------------------------------------|------------------------------------------------------|
21-
| UniFi Network Application/controller | 5.x, 6.x, 7.x, 8.x, 9.0.x (**9.0.101 is confirmed**) |
22-
| UniFi OS | 3.x, 4.1.x (**4.1.9 is confirmed**) |
19+
| Software | Versions |
20+
|--------------------------------------|---------------------------------------------------|
21+
| UniFi Network Application/controller | 5.x, 6.x, 7.x, 8.x, 9.x (**9.3.45 is confirmed**) |
22+
| UniFi OS | 3.x, 4.1.x, 4.2.x (**4.3.6 is confirmed**) |
2323

2424

2525
## Requirements
@@ -28,18 +28,20 @@ easy inclusion in your projects. See the [installation instructions](#Installati
2828
- PHP **7.4.0** or higher (use version [1.1.83](https://github.com/Art-of-WiFi/UniFi-API-client/releases/tag/v1.1.83)
2929
for PHP 7.3.x and lower)
3030
- PHP json and PHP cURL modules enabled
31-
- direct network connectivity between this server and the host and port (usually TCP port 8443 or port 443 for
32-
UniFi OS) where the UniFi Controller is running
33-
- you **must** use an **account with local access permissions** to access the UniFi Controller API through this class
34-
- do not use UniFi Cloud accounts and do not enable 2FA for the accounts that you use with this class
31+
- direct network connectivity between this server and the host and port (usually TCP port 8443, port 11443 for UniFi OS
32+
Server, or port 443 for UniFi OS consoles) where the UniFi Network Application is running
33+
- you **must** use an admin **account with local access permissions** to access the API through this class as explained
34+
here: https://artofwifi.net/blog/use-local-admin-account-unifi-api-captive-portal
35+
- do **not** use UniFi Cloud accounts and do not enable MFA/2FA for the accounts that you use with this class
3536

3637

3738
## UniFi OS Support
3839

39-
Besides the "software-based" UniFi controllers, this class also supports UniFi OS-based controllers starting from
40-
version **1.1.47**.
40+
Besides the classic "software-based" UniFi Network Application, this class also supports UniFi OS-based
41+
controllers starting from version **1.1.47**.
4142

4243
These devices/services have been verified to work:
44+
- UniFi OS Server, announcement [here](https://blog.ui.com/article/introducing-unifi-os-server)
4345
- UniFi Dream Router (UDR)
4446
- UniFi Dream Machine (UDM)
4547
- UniFi Dream Machine Pro (UDM PRO)
@@ -51,13 +53,16 @@ These devices/services have been verified to work:
5153
- UniFi CloudKey Enterprise (CK-Enterprise)
5254
- UniFi Enterprise Fortress Gateway (EFG)
5355
- Official UniFi Hosting, details [here](https://help.ui.com/hc/en-us/articles/4415364143511)
56+
- HostiFi UniFi Cloud Hosting, details [here](https://hostifi.com/unifi)
5457

55-
The class automatically detects UniFi OS consoles and adjusts the URLs and several functions/methods accordingly.
58+
The class automatically detects UniFi OS consoles/servers and adjusts the URLs and several functions/methods
59+
accordingly.
5660

57-
UniFi OS-based controllers require you to connect using port **443** instead of **8443** which is used for
58-
"software-based" controllers. If your own code implements strict validation of the URL that is passed to the
59-
constructor, please adapt your logic to allow URLs without a port suffix or with port 443 when working with a
60-
UniFi OS-based controller.
61+
UniFi OS-based consoles require you to connect using port **443** instead of **8443** which is used for
62+
the classic "software-based" controllers. When using **UniFi OS Server**, you are required to use port **11443**.
63+
64+
If your own code implements strict validation of the URL that is passed to the constructor, please adapt your logic to
65+
allow URLs without a port suffix, with port 443 or port 11443 when working with a UniFi OS-based controller.
6166

6267

6368
### Remote API access to UniFi OS-based controllers
@@ -73,7 +78,8 @@ The "custom firewall rule" approach described there is the recommended method.
7378
When upgrading from a version before **2.0.0**, please:
7479
- change your code to use the new Exceptions that are thrown by the class
7580
- test the client with your code for any breaking changes
76-
- make sure you are using [Composer](#composer) to install the class because the code is no longer held within a single file
81+
- make sure you are using [Composer](#composer) to install the class because the code is no longer held within a single
82+
file
7783
- see the note [here](#looking-for-version-1xx) regarding the single file version (1.x.x) of the API client
7884

7985

@@ -289,6 +295,16 @@ If you would like to contribute to this project, please open an issue and includ
289295
your suggestions or code there or else create a pull request.
290296

291297

298+
## About Art of WiFi
299+
300+
Art of WiFi develops software and tools that enhance the capabilities of UniFi networks. From captive portals and
301+
reporting solutions to device search utilities, our goal is to make UniFi deployments more powerful and easier to
302+
manage.
303+
304+
If you're looking for a specific solution or just want to see what else we offer, feel free to explore our web site:
305+
- https://www.artofwifi.net
306+
307+
292308
## Important Disclaimer
293309

294310
Many of the functions in this API client class are not officially supported by Ubiquiti

vendor/art-of-wifi/unifi-api-client/examples/ppsks_examples/create_ppsk.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
/**
4242
* The new PPSK details.
4343
*/
44-
$new_ppsk_password = 'mysecretppsk'; // the password for the new PPSK, this password must be unique for the SSID
44+
$new_ppsk_password = 'mysecretppsk'; // the password for the new PPSK, this password must be unique for the SSID, between 8-63 characters
4545
$new_ppsk_network_id = 'zzzzzzzzzzzzzzzzzzzzz'; // id for the required VLAN, taken from the output of list_networkconf()
4646
$new_ppsk_wlan_id = 'xxxxxxxxxxxxxxxxxxxxx'; // id for the required WLAN, taken from the output of list_wlanconf()
4747

0 commit comments

Comments
 (0)