UniFi Network icon

UniFi Network

Work with the UniFi Network API

Actions3

Overview

This node integrates with the UniFi Network API to retrieve various data related to network management. Specifically, for the Device resource and the Get Statistics operation, it fetches statistical information about a particular device within a specified site. This is useful for network administrators who want to monitor device performance, usage metrics, or health status.

Practical examples include:

  • Retrieving traffic statistics of a specific access point or switch.
  • Monitoring device uptime or error rates.
  • Collecting data for reporting or alerting on device behavior.

Properties

Name Meaning
Site ID The unique identifier of the site where the device is located. Required for the request.
Device ID The unique identifier of the device for which statistics are requested. Required.

Output

The node outputs JSON data containing the statistics of the specified device. The structure typically includes various metrics such as traffic data, connection counts, error rates, or other device-specific statistics provided by the UniFi Network API.

If the API supports binary data (e.g., logs or reports), it would be included in the binary output field, but based on the static code, this node primarily returns JSON-formatted statistics.

Dependencies

  • Requires an active UniFi Network API key credential configured in n8n.
  • Needs the base URL of the UniFi controller host.
  • The node uses the UniFi Network API endpoint /proxy/network/integration/v1.
  • Proper network access to the UniFi controller is necessary.

Troubleshooting

  • Invalid API Key Error: If the API key is incorrect or expired, the node will return an authentication error. Verify and update the API key credential.
  • Missing Required Properties: Both Site ID and Device ID must be provided; otherwise, the request will fail.
  • Network Connectivity Issues: Ensure that the n8n instance can reach the UniFi controller host URL.
  • API Endpoint Changes: If the UniFi API changes, the node might fail; check for updates or compatibility issues.

Links and References

Discussion