You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,13 +11,13 @@ This tool is for browsing data that is exposed through Ubiquiti's UniFi Controll
11
11
12
12
It comes bundled with a **PHP class for access to the UniFi Controller API**, which supports [more API endpoints](https://github.com/Art-of-WiFi/UniFi-API-client#methods-and-functions-supported) than the UniFi API browser tool does.
13
13
14
-
If you plan to create your own PHP code levering the UniFi controller API, it is recommended to use the standalone version of the API client class which can be found here: https://github.com/Art-of-WiFi/UniFi-API-client
14
+
If you plan to create your own PHP code leveraging the UniFi controller API, it is recommended to use the standalone version of the API client class which can be found here: https://github.com/Art-of-WiFi/UniFi-API-client
15
15
16
16
You will find examples and detailed instructions there.
17
17
18
18
Please keep the following in mind:
19
19
- the API Browser tool doesn't support all available data collections/API endpoints, see the list below of those that are currently supported
20
-
- currently, versions 4.x.x and 5.x.x of the UniFi Controller software are supported (version 5.6.18 has been confirmed to work)
20
+
- currently, versions 4.x.x and 5.x.x of the UniFi Controller software are supported (version 5.7.20 has been confirmed to work)
21
21
- there is still work to be done to add/improve functionality and usability of this tool so suggestions/comments are welcome. Please use the github [issue](https://github.com/Art-of-WiFi/UniFi-API-browser/issues) list or the Ubiquiti Community forums (https://community.ubnt.com/t5/UniFi-Wireless/UniFi-API-browser-tool-released/m-p/1392651) to share your ideas/questions.
22
22
- please read the Security Notice below before installing this tool!
23
23
@@ -81,6 +81,7 @@ The UniFi API browser tool offers the following features:
81
81
- list current channels
82
82
- list DPI stats
83
83
- dynamic DNS configuration
84
+
- list country codes
84
85
- list Radius accounts (supported on controller version 5.5.19 and higher)
Copy file name to clipboardExpand all lines: vendor/art-of-wifi/unifi-api-client/README.md
+41-24Lines changed: 41 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,17 @@
1
-
## UniFi controller API client class
1
+
## UniFi Controller API client class
2
2
3
-
A PHP class which provides access to Ubiquiti's **UniFi Controller API**. Versions 4.x.x and 5.x.x of the UniFi Controller software are supported (version 5.6.18 has been confirmed to work). It's a standalone version of the class which is used in our API browser tool [here](https://github.com/Art-of-WiFi/UniFi-API-browser).
3
+
A PHP class which provides access to Ubiquiti's **UniFi Controller API**, versions 4.x.x and 5.x.x of the UniFi Controller software are supported (version 5.6.29 has been confirmed to work). It's a standalone version of the class which is used in our API browser tool which can be found[here](https://github.com/Art-of-WiFi/UniFi-API-browser).
4
4
5
-
This class can now also be installed using composer/[packagist](https://packagist.org/packages/art-of-wifi/unifi-api-client) for easy inclusion in your projects.
6
-
7
-
### Donations
8
-
9
-
If you'd like to support further development of this PHP API client class, please use the PayPal donate button below. All donations go to the project maintainer.
This class can be installed using composer/[packagist](https://packagist.org/packages/art-of-wifi/unifi-api-client) for easy inclusion in your projects.
12
6
13
7
## Methods and functions supported
14
8
15
-
The class currently supports the following functions/methods to get/post/put/delete data through the UniFi controller API:
9
+
The class currently supports the following functions/methods to get/post/put/delete data through the UniFi Controller API:
10
+
16
11
- login()
17
12
- logout()
18
13
- adopt_device()
14
+
- archive_alarm()
19
15
- authorize_guest()
20
16
- block_sta()
21
17
- count_alarms()
@@ -26,6 +22,7 @@ The class currently supports the following functions/methods to get/post/put/del
26
22
- create_usergroup()
27
23
- create_voucher()
28
24
- create_wlan()
25
+
- delete_device()
29
26
- delete_network()
30
27
- delete_radius_account()
31
28
- delete_site()
@@ -36,9 +33,11 @@ The class currently supports the following functions/methods to get/post/put/del
36
33
- extend_guest_validity()
37
34
- led_override()
38
35
- list_admins()
36
+
- list_all_admins()
39
37
- list_alarms()
40
38
- list_aps() (deprecated but still available as alias)
41
39
- list_clients()
40
+
- list_country_codes()
42
41
- list_current_channels()
43
42
- list_dashboard()
44
43
- list_devices()
@@ -66,6 +65,7 @@ The class currently supports the following functions/methods to get/post/put/del
66
65
- list_wlan_groups()
67
66
- list_wlanconf()
68
67
- locate_ap()
68
+
- move_device()
69
69
- power_cycle_switch_port()
70
70
- reconnect_sta()
71
71
- rename_ap()
@@ -74,9 +74,18 @@ The class currently supports the following functions/methods to get/post/put/del
74
74
- set_ap_radiosettings()
75
75
- set_device_settings_base()
76
76
- set_guestlogin_settings()
77
+
- set_guestlogin_settings_base()
77
78
- set_locate_ap() (deprecated but still available as alias)
78
79
- set_networksettings_base()
79
80
- set_radius_account_base()
81
+
- set_site_connectivity()
82
+
- set_site_country()
83
+
- set_site_guest_access()
84
+
- set_site_locale()
85
+
- set_site_mgmt()
86
+
- set_site_name()
87
+
- set_site_ntp()
88
+
- set_site_snmp()
80
89
- set_sta_name()
81
90
- set_sta_note()
82
91
- set_usergroup()
@@ -111,24 +120,25 @@ The class currently supports the following functions/methods to get/post/put/del
111
120
- upgrade_device_external()
112
121
113
122
Internal functions, getters/setters:
123
+
114
124
- set_debug()
115
-
-set_site()
125
+
-get_debug()
116
126
- set_site()
117
127
- get_site()
118
128
- get_cookie() (renamed from getcookie())
119
129
- get_last_results_raw()
120
130
- get_last_error_message()
121
131
122
-
Please refer to the source code for more details on each function/method and their parameters.
132
+
Please refer to the source code for more details on the functions/methods and their parameters.
123
133
124
134
## Requirements
125
135
126
136
- a web server with PHP and cURL modules installed (tested on apache2 with PHP Version 5.6.1 and cURL 7.42.1)
127
-
- network connectivity between this web server and the server and port (normally TCP port 8443) where the UniFi controller is running
137
+
- network connectivity between this web server and the server and port (normally TCP port 8443) where the UniFi Controller is running
128
138
129
139
## Installation ##
130
140
131
-
You can use **Composer**, **Git** or simply **Download the Release** to install the API client class.
141
+
You can use [Composer](#composer), [Git](#git) or simply [Download the Release](#download-the-release) to install the API client class.
132
142
133
143
### Composer
134
144
@@ -138,6 +148,16 @@ Once composer is installed, simply execute this command from the shell in your p
138
148
139
149
```sh
140
150
composer require art-of-wifi/unifi-api-client
151
+
```
152
+
153
+
Or you can manually add the package to your composer.json file:
154
+
155
+
```javascript
156
+
{
157
+
"require": {
158
+
"art-of-wifi/unifi-api-client":"^1.1"
159
+
}
160
+
}
141
161
```
142
162
143
163
Finally, be sure to include the autoloader in your code:
@@ -189,18 +209,15 @@ $results = $unifi_connection->list_alarms(); // returns a PHP array con
189
209
190
210
Please refer to the `examples/` directory for some more detailed examples which you can use as a starting point for your own PHP code.
191
211
192
-
### IMPORTANT NOTES:
193
-
194
-
In the example above, the last parameter (`true`) that is passed to the constructor, enables validation of the controller's SSL certificate which is otherwise **disabled** by default.
195
-
It is highly recommended to enable this feature in production environments where you have a valid SSL cert installed on the UniFi controller, and which is associated with the FQDN of the server as used in the `controller_url` parameter. This option was added with API client version 1.1.16.
212
+
#### IMPORTANT NOTES:
196
213
197
-
---
214
+
1. The last parameter (`true`) that is passed to the constructor, enables validation of the controller's SSL certificate which is otherwise **disabled** by default. It is highly recommended to enable this feature in production environments where you have a valid SSL cert installed on the UniFi Controller, and which is associated with the FQDN of the server as used in the `controller_url` parameter. This option was added with API client version 1.1.16.
198
215
199
-
In the example above, `$site_id` is the 8 character short site "name" which is visible in the URL when managing the site in the UniFi controller:
216
+
2.In the example above, `$site_id` is the 8 character short site "name" which is visible in the URL when managing the site in the UniFi Controller:
200
217
201
-
`https://<controller IP address or FQDN>:8443/manage/site/jl3z2shm/dashboard`
218
+
`https://<controller IP address or FQDN>:8443/manage/site/jl3z2shm/dashboard`
202
219
203
-
In this case, `jl3z2shm` is the value required for $site_id.
220
+
In this case, `jl3z2shm` is the value required for $site_id.
204
221
205
222
## Need help or have suggestions?
206
223
@@ -212,11 +229,11 @@ If you would like to contribute code (improvements), please open an issue and in
212
229
213
230
## Credits
214
231
215
-
This class is largely based on the work done by the following developers:
232
+
This class is based on the work done by the following developers:
- and the API as published by Ubiquiti: https://dl.ubnt.com/unifi/5.6.18-8261dc5066/unifi_sh_api
219
236
220
237
## Important Disclaimer
221
238
222
-
Many of the functions in this API client class are not officially supported by UBNT and as such, may not be supported in future versions of the UniFi controller API.
239
+
Many of the functions in this API client class are not officially supported by UBNT and as such, may not be supported in future versions of the UniFi Controller API.
0 commit comments