applied tweaks to the the README file

This commit is contained in:
malle-pietje
2025-12-01 11:39:15 +01:00
parent d240294cee
commit e9bdb783c9
2 changed files with 26 additions and 162 deletions

View File

@@ -37,12 +37,12 @@ easy inclusion in your projects. See the [installation instructions](#Installati
## Requirements
- a server with:
- a server or desktop with:
- 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)
for PHP 7.3.x and lower)
- PHP cURL (`php-curl`) module enabled
- direct network connectivity between this server and the host and port (usually TCP port 8443, port 11443 for UniFi OS
Server, or port 443 for UniFi OS consoles) where the UniFi Network Application is running
- direct network connectivity between this server/desktop and the host and port where the UniFi Network Application is
running (usually TCP port 8443, port 11443 for UniFi OS Server, or port 443 for UniFi OS consoles)
- you **must** use an admin **account with local access permissions** to access the API through this class as explained
here:
https://artofwifi.net/blog/use-local-admin-account-unifi-api-captive-portal
@@ -127,7 +127,7 @@ require_once 'vendor/autoload.php';
## Example usage
A basic example of how to use the class:
A quick and basic example of how to use the class:
```php
/**
@@ -144,8 +144,6 @@ $login = $unifi_connection->login();
$results = $unifi_connection->list_alarms(); // returns a PHP array containing alarm objects
```
More examples are available in the `examples/` directory.
#### IMPORTANT NOTES:
@@ -167,6 +165,9 @@ More examples are available in the `examples/` directory.
[issue](https://github.com/Art-of-WiFi/UniFi-API-browser/issues/94) for an example where the WPA2 password isn't
visible for **read-only** administrator accounts.
### Code Examples:
More code examples are available in the [`examples/`](examples/) directory.
## Exception handling
@@ -251,16 +252,30 @@ their purpose, and their respective parameters.
If you are using an advanced IDE such as PHPStorm or VS Code, you can use its code completion and other
features to explore the available functions/methods thanks to the extensive PHP DocBlocks throughout the code.
For a quick overview of the available functions/methods, you can also check the API Reference here:
For a quick overview of the available functions/methods, you can also check the API Reference here:
[API Reference](API_REFERENCE.md)
## Need help or have suggestions?
There is still work to be done to add functionality and further improve the usability of
this class, so all suggestions/comments are welcome. Please use the GitHub
[Issues section](https://github.com/Art-of-WiFi/UniFi-API-client/issues) or the Ubiquiti
Community forums (https://community.ui.com/questions/PHP-client-class-to-access-the-UniFi-controller-API-updates-and-discussion-part-2/a793904e-6023-4a7f-bcae-340db2a03fc1)
to share your suggestions and questions.
#### IMPORTANT NOTE:
When encountering issues with the UniFi API using other libraries, cURL or Postman, please do **not** open an Issue.
Such issues will be closed immediately. Please use the [Discussions](https://github.com/Art-of-WiFi/UniFi-API-client/discussions) section instead.
## Looking for version 1.x.x?
With versions 1.x.x of the API client, the entire client was contained within a single file which can be useful in
specific cases.
This has changed with version 2.0.0 where the code is now split across multiple files and is managed using composer.
This has changed with version 2.0.0 where the code is now split across multiple files and inclusion in your project is
managed using composer.
If you are looking for the version 1.x.x code, you can tell composer to install that version by using the following
syntax in your `composer.json` file:
@@ -277,19 +292,6 @@ Alternatively, you can download the latest 1.x.x code from the [releases page](h
Whenever necessary, we will make sure to update the **version_1** branch with the latest 1.x.x code.
## Need help or have suggestions?
There is still work to be done to add functionality and further improve the usability of
this class, so all suggestions/comments are welcome. Please use the GitHub
[Issues section](https://github.com/Art-of-WiFi/UniFi-API-client/issues) or the Ubiquiti
Community forums (https://community.ui.com/questions/PHP-client-class-to-access-the-UniFi-controller-API-updates-and-discussion-part-2/a793904e-6023-4a7f-bcae-340db2a03fc1)
to share your suggestions and questions.
#### IMPORTANT NOTE:
When encountering issues with the UniFi API using other libraries, cURL or Postman, please do **not** open an Issue. Such issues will be closed immediately.
Please use the [Discussions](https://github.com/Art-of-WiFi/UniFi-API-client/discussions) section instead.
## Credits

142
TODO.md
View File

@@ -6,143 +6,5 @@
## Routes to add
- /v2/api/site/mdfwaanp/models
- output example:
```json
{
"model_list": [
{
"default_image_id": "73f9d3a4696f0b054c2e3b54a649222e",
"id": "b5a1a302-35fe-4605-92ef-6a4f66222097",
"model_abbreviation": "USW Pro 8 PoE",
"model_fullName": "Switch Pro 8 PoE",
"model_name": "USLP8P",
"model_sysid": "ed5a",
"nopadding_image_id": "567137edae9f99ecf99958560aad1b0e",
"sku": "USW-Pro-8-PoE",
"topology_image_id": "597b0990c410ded0bcc9069d6f308312"
},
{
"default_image_id": "4fac659e9e888a9298a9f24ce02373b2",
"id": "181ce560-876b-4619-bee6-5f4e20fb2f93",
"model_abbreviation": "AC Lite",
"model_fullName": "Access Point AC Lite",
"model_name": "U7LT",
"model_sysid": "e517",
"nopadding_image_id": "1f7055cef4ac72105793b78116c49be4",
"sku": "UAP-AC-LITE",
"topology_image_id": "38a7861f0e5a0dd684f182bdd2384ed2"
},
{
"default_image_id": "e37ba48acdfe7e94f62d49a757e37db4",
"id": "f84319ea-3df6-429e-a0b5-36587271d094",
"model_abbreviation": "FlexHD",
"model_fullName": "Access Point FlexHD",
"model_name": "UFLHD",
"model_sysid": "ec26",
"nopadding_image_id": "e61c75aa3151978ce8ef07735d15a154",
"sku": "UAP-FlexHD",
"topology_image_id": "eb04daf3e215ef98650a75eda5ca8cfa"
},
{
"default_image_id": "7ab4da709aff50bae187555a6d084f90",
"id": "8d084b12-98d6-4b10-9168-cf319e170cef",
"model_abbreviation": "USW Lite 16 PoE",
"model_fullName": "Switch Lite 16 PoE",
"model_name": "USL16LP",
"model_sysid": "ed26",
"nopadding_image_id": "c1e76f81b46a31d8da6ba7de56cb33cf",
"sku": "USW-Lite-16-PoE",
"topology_image_id": "51983b94e9b75075f12c836f7be994ef"
},
{
"default_image_id": "88b840fbb548b263bac30e4d335d5f5a",
"id": "dac2c752-2b31-406f-96ed-36859261f293",
"model_abbreviation": "UXG Max",
"model_fullName": "Gateway Max",
"model_name": "UXGB",
"model_sysid": "a690",
"nopadding_image_id": "5a3ce86efe3466e8166fdce51245c3bf",
"sku": "UXG-Max",
"topology_image_id": "7023b1f7e2d5b7835ba752b2d73786c7"
},
{
"default_image_id": "4fac659e9e888a9298a9f24ce02373b2",
"id": "fa66c9b2-ba69-4f34-b346-051753cda2e9",
"model_abbreviation": "U6 LR+",
"model_fullName": "Access Point U6 Long-Range+",
"model_name": "UALRPL6",
"model_sysid": "a643",
"nopadding_image_id": "1f7055cef4ac72105793b78116c49be4",
"sku": "U6-PLUS-LR",
"topology_image_id": "38a7861f0e5a0dd684f182bdd2384ed2"
},
{
"default_image_id": "1ed05326d26c963560c53bcd6fb1b2ae",
"id": "b6a7f692-39e2-4942-989e-874e5166ef3b",
"model_abbreviation": "USW Lite 8 PoE",
"model_fullName": "Switch Lite 8 PoE",
"model_name": "USL8LP",
"model_sysid": "ed2a",
"nopadding_image_id": "e949b1092dc5ef48507eeadf2cbf54f9",
"sku": "USW-Lite-8-PoE",
"topology_image_id": "46351a4e28941c0f17caf96515e94921"
},
{
"default_image_id": "d63e8b9562026c12b4b50223cfc93170",
"id": "95b82866-f941-4cb0-aa79-58392dbcb7f6",
"model_abbreviation": "USW Pro 24 PoE",
"model_fullName": "Switch Pro 24 PoE",
"model_name": "US24PRO",
"model_sysid": "eb36",
"nopadding_image_id": "b1cd82277458c19e297cd2d9155b32c7",
"sku": "USW-Pro-24-PoE",
"topology_image_id": "61340cc158b3b9a1e6208f254749b5e7"
},
{
"default_image_id": "fdde25abe697d20acefee603964b9e1f",
"id": "5931f835-5029-42da-8676-c4e57003b2cd",
"model_abbreviation": "USW Enterprise 8 PoE",
"model_fullName": "Switch Enterprise 8 PoE",
"model_name": "US68P",
"model_sysid": "ed41",
"nopadding_image_id": "d523e7d05829b2af8f543963f38938b2",
"sku": "USW-Enterprise-8-PoE",
"topology_image_id": "afe8af0c80987dfbe67c468fca6dc107"
},
{
"default_image_id": "f3707f0e330a3a3d01a90e8f1453123f",
"id": "6f5cefaf-6810-4525-aafd-ea704c1f50b9",
"model_abbreviation": "U7 Pro XG",
"model_fullName": "Access Point U7 Pro XG",
"model_name": "UAPA6AE",
"model_sysid": "a6ae",
"nopadding_image_id": "8e935c2f582b72b1663bff60d2fe9b6d",
"sku": "U7-Pro-XG-B",
"topology_image_id": "2a0688bcbc8ac4d9dc70518dcccb31a9"
},
{
"default_image_id": "4fac659e9e888a9298a9f24ce02373b2",
"id": "bc0e1444-3b03-4b10-9997-4f200cdf3709",
"model_abbreviation": "AC HD",
"model_fullName": "Access Point AC HD",
"model_name": "U7HD",
"model_sysid": "e530",
"nopadding_image_id": "1f7055cef4ac72105793b78116c49be4",
"sku": "UAP-AC-HD",
"topology_image_id": "38a7861f0e5a0dd684f182bdd2384ed2"
},
{
"default_image_id": "b2c61e16e3576a6dd64ebda28fa0e946",
"id": "1725ba05-79e0-43d1-9551-be834f7fe536",
"model_abbreviation": "USW Flex",
"model_fullName": "Switch Flex",
"model_name": "USF5P",
"model_sysid": "ed10",
"nopadding_image_id": "28f4d753fcee6d44554dc51004cb2dc3",
"sku": "USW-Flex",
"topology_image_id": "4377d80591a11c08dea39280b18d40d9"
}
]
}
```
- [x] /v2/api/site/mdfwaanp/models
-