unifi-php-api/examples
malle-pietje 6f1b75b89a updated comments for stats-related methods/function to make clear start/end values must be provided in milliseconds
changed use of objects as payload input for json_encode, to associative arrays for consistency
added functions/methods for firewall groups: list_firewallgroups(), create_firewallgroup(), edit_firewallgroup(), delete_firewallgroup()
added checks for required boolean parameters
2018-08-19 12:00:19 +02:00
..
site_provisioning_example General code cleanup (replace tabs by spaces, etc.) 2018-03-24 10:46:42 +01:00
ap_scanning_state.php minor changes to examples and README for consistency 2017-09-07 12:31:47 +02:00
ap_upgrade_firmware.php General code cleanup (replace tabs by spaces, etc.) 2018-03-24 10:46:42 +01:00
auth_guest_basic.php minor changes to examples and README for consistency 2017-09-07 12:31:47 +02:00
auth_guest_with_note.php added example to change AC-IW port config 2018-03-24 09:28:25 +01:00
block_list.php added unblock_list.php and block_list.php examples, contributed by @malcolmcif 2018-05-21 13:06:50 +02:00
change_wlan_password.php fixed typo in examples/change_wlan_password.php 2017-10-06 12:55:44 +02:00
config.template.php Add ap_upgrade_firmware.php to Examples (#12) 2018-03-18 14:28:40 +01:00
create_site.php minor bugs removed from two examples 2018-02-01 17:11:05 +01:00
create_voucher.php minor code cleanup and various changes: 2017-10-06 12:46:07 +02:00
delete_site.php minor bugs removed from two examples 2018-02-01 17:11:05 +01:00
disable_device.php Update disable_device.php 2017-10-20 09:25:59 +02:00
extend_guest_auth.php General code cleanup (replace tabs by spaces, etc.) 2018-03-24 10:46:42 +01:00
list_alarms.php minor changes to examples and README for consistency 2017-09-07 12:31:47 +02:00
list_ap_connected_users.php General code cleanup (replace tabs by spaces, etc.) 2018-03-24 10:46:42 +01:00
list_site_health.php General code cleanup (replace tabs by spaces, etc.) 2018-03-24 10:46:42 +01:00
list_social_auth_details.php minor changes to examples and README for consistency 2017-09-07 12:31:47 +02:00
list_user_stats.php added user/client device stats methods/functions: 2018-07-02 15:06:31 +02:00
README.md updated comments for stats-related methods/function to make clear start/end values must be provided in milliseconds 2018-08-19 12:00:19 +02:00
test_connection.php minor code cleanup and various changes: 2017-10-06 12:46:07 +02:00
toggle_led.php minor changes to examples and README for consistency 2017-09-07 12:31:47 +02:00
unblock_list.php added unblock_list.php and block_list.php examples, contributed by @malcolmcif 2018-05-21 13:06:50 +02:00
update_ac-iw_ports.php General code cleanup (replace tabs by spaces, etc.) 2018-03-24 10:46:42 +01:00
update_device_wlan_settings_5.5.X.php added example to change AC-IW port config 2018-03-24 09:28:25 +01:00

API client class usage examples

This directory contains some PHP code examples which demonstrate usage of the PHP API client class and can be used as a good starting point for your own custom code.

Usage

Copy the appropriate example file to your working directory together with a copy of the config.template.php file which should be renamed to config.php. Then update the contents of your new config.php with your controller details and credentials and modify the example file as required to fit your needs.

Also make sure to update the path for the composer autoloader file (vendor/autoload.php) or the file containing the Class itself (src/Client.php) in your require_once() statement as required.

Contribute

If you would like to share your own example file(s), please open an issue and include your code there or else create a pull request.

Important Disclaimer

Use these examples at your own risk!