UniFi-API-client

A PHP API client class to interact with Ubiquiti's UniFi Controller API

MIT License

Downloads
238.7K
Stars
1.1K
Committers
11

Bot releases are hidden (Show)

UniFi-API-client - API client class v1.1.54

Published by malle-pietje over 4 years ago

  • fixed list_alarms() method/function
UniFi-API-client - API client class v1.1.53

Published by malle-pietje over 4 years ago

  • added list_routing() method/function, contributed by @VWT-Dan
  • added list_firmware() method/function
  • added get_class_version() method/function, returns the (semantic) version number of the Class
  • cleaned up the class to remove repetitive code
  • changed names of several protected functions for improved consistency
  • general code clean up
UniFi-API-client - API client class v1.1.52

Published by malle-pietje over 4 years ago

  • fixed exec_curl() for cases where the cookie has expired and we need to re-login
  • removed obsolete functions/methods
UniFi-API-client - API client class v1.1.51

Published by malle-pietje over 4 years ago

  • updated README with all getter and setter methods/functions
  • updated get_cookies() and get_cookie() for consistency
  • get_cookie() remains for backward compatibility only, should not be used in new code
  • fix rare cases where the client would end up in a loop, e.g. issuing a request for a site the cached credentials have no access to
UniFi-API-client - API client class v1.1.50

Published by malle-pietje over 4 years ago

  • removed several unnecessary if statements
  • added getter and setter for unifi_os property
  • fixed logout method when working with UniFi OS-based controllers
UniFi-API-client - API client class v1.1.49

Published by malle-pietje over 4 years ago

  • improvements to internal use of $_SESSION['unificookie']
  • other minor code improvements
  • applies several applied patches as suggested by scrutinizer-ci.com
UniFi-API-client - API client class v1.1.48

Published by malle-pietje over 4 years ago

  • applied patches to Client.php as suggested by scrutinizer-ci.com
  • moved resource checks to get_curl_resource() method/function
  • extended create_user() function/method with several optional parameters
  • changed headers that are passed with each request containing a payload
UniFi-API-client - API client class v1.1.47

Published by malle-pietje over 4 years ago

  • applied patches to update_switch_poe-mode.php as suggested by scrutinizer-ci.com
  • code clean up and improvements in preparation of support for UniFi OS-based controllers
  • added support for UniFi OS-based controllers, thanks to @Scyto for providing access
  • adapt login route and method, and base URL for UniFi OS-based controllers
  • automatically identify UniFi OS-based controllers, thanks to @TwitchCaptain for this and several other suggestions
  • relaxed URL validation to allow UniFi OS-based controllers to pass
  • changed default HTTP method to GET
  • many improvements throughout the code
UniFi-API-client - API client class v1.1.46

Published by malle-pietje over 4 years ago

  • applied patches to update_switch_poe-mode.php as suggested by scrutinizer-ci.com
  • placed warning that UniFI OS is not (yet) supported
UniFi-API-client - API client class v1.1.45

Published by malle-pietje over 4 years ago

  • added function/method force_provision(), contributed by @VWT-Dan
  • added example update_switch_poe-mode.php, contributed by @Kaltt
UniFi-API-client - API client class v1.1.44

Published by malle-pietje over 4 years ago

  • added example script reconnect_client.php
  • fixed typo in URL linking to UniFi section on the UI.com site
  • add function/method reboot_cloudkey(), contributed by @leonardogyn
UniFi-API-client - API client class v1.1.43

Published by malle-pietje almost 5 years ago

  • updated code and instructions for set_guestlogin_settings(), thanks to @stoehrmark for reporting the issue
  • added list_connected_users.php example, contributed by @gahujipo
  • added restart_device() which replaces restart_ap(), contributed by @leonardogyn
  • code styling cleanup across Client.php
UniFi-API-client - API client class v1.1.42

Published by malle-pietje about 5 years ago

  • changed variable name $url to $path in custom_api_request() for consistency and clarity
  • rearranged layout of Client.php
  • added check to verify whether $ch is a resource
  • renamed get_curl_obj() to get_curl_resource() to reflect the variable type it returns

Added the new functions/methods:

  • set_super_mgmt_settings_base()
  • set_super_smtp_settings_base()
  • set_super_identity_settings_base()
UniFi-API-client - API client class v1.1.41

Published by malle-pietje over 5 years ago

  • changed create_wlan function/method to not include passphrase in payload when security = "open" and passphrase = null
  • fixed indentations in several places
  • added custom_api_request() function/method which allows a programmer to issue custom API requests that may not yet be supported by this client (to be used with care!)
  • added example demonstrating use of custom_api_request()
  • removed repetitive code and optimized exec_curl() when creating the final payload, resulting in 10-20% performance increase and slightly lower memory consumption by PHP
UniFi-API-client - API client class v1.1.40

Published by malle-pietje over 5 years ago

fixed functions assign_existing_admin() and invite_admin() to support controller versions 5.9 and higher because of observed changes in controller behavior

UniFi-API-client - API client class v1.1.39

Published by malle-pietje over 5 years ago

added function/method assign_existing_admin()
fixed code for function/method invite_admin()
minor code tweaks for improved readability

UniFi-API-client - API client class v1.1.38

Published by malle-pietje almost 6 years ago

made regex to extract cookies case-insensitive, though this would only be needed for corner cases this is still RFC compliant (https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2), thanks to @ericfri
changed the layout of the README file to put more emphasis on the installation options and the basic example, and less on the list of methods/functions

UniFi-API-client - API client class v1.1.37

Published by malle-pietje almost 6 years ago

updated both READMEs
added cmd_stat() function, can currently only be used to reset DPI counters for the current site
added optional group_id parameter to list_firewallgroups() which allows you to select a single firewall group, thanks to @VWT-Dan for the suggestion

UniFi-API-client - API client class v1.1.36

Published by malle-pietje almost 6 years ago

added methods stat_ips_events(), set_ips_settings_base(), supported with controllers 5.9.10 and higher
thanks go to @leonardogyn for providing access to a 5.9.29 controller and test network for test/validation purposes

UniFi-API-client - API client class v1.1.35

Published by malle-pietje almost 6 years ago

general code cleanup:

  • added spaces throughout Client.php following PSR-2 guidelines that were skipped in the previous commit
  • added visibility to constructor and destructor methods following PSR-2 recommendations
  • declare user and password properties and visibility following PSR-2 recommendations
  • updated README to add recently added functions/methods
  • minor general changes to the README