Create Standalone Device icon

Create Standalone Device

Create a standalone device

Overview

This node creates a standalone device by sending its details to an external API endpoint. It is useful in scenarios where you need to register or add new devices programmatically into a system that manages standalone devices, such as network management platforms or IoT device registries.

For example, if you have a list of devices with their names, descriptions, serial numbers, and IP addresses, this node can automate the process of creating these devices in the target system without manual entry.

Properties

Name Meaning
Device Name The name assigned to the standalone device (e.g., "My Device").
Description A textual description providing details about the device.
Serial Number The unique serial number identifying the device (e.g., "SN123456789").
IP Address The IP address assigned to the device (e.g., "192.168.1.100").

Output

The node outputs a JSON object for each input item processed, containing:

  • success: Boolean indicating whether the device creation was successful.
  • id: The unique identifier of the created device returned by the API (present only on success).
  • name, description, serialNumber, ip: Echoes back the input properties for reference.
  • response: The full response object from the API call.
  • On failure, it includes:
    • error: Error message describing what went wrong.
    • statusCode: HTTP status code returned by the API.
    • response: The error response body or text from the API.

The node does not output binary data.

Dependencies

  • Requires an API key credential to authenticate requests to the external firewall or device management API.
  • The API base URL is retrieved from the credentials.
  • The node sends HTTP POST requests to the endpoint /api/pt/devices/standalone on the configured API server.
  • The request headers specify content type as JSON and set the language preference to Vietnamese (Accept-Language: vi).

Troubleshooting

  • Common issues:

    • Invalid or missing API credentials will cause authentication failures.
    • Incorrect or unreachable API URL may result in network errors.
    • Validation errors if required fields (name, description, serial number, IP) are missing or malformed.
    • API rate limits or server errors could cause request failures.
  • Error messages:

    • Errors include detailed messages, HTTP status codes, and API response bodies when available.
    • If the node is set to continue on fail, it logs the error and outputs failure information per item.
    • Otherwise, it throws a detailed error including the request URL and body for easier debugging.
  • Resolution tips:

    • Verify API credentials and permissions.
    • Confirm the API URL is correct and accessible.
    • Ensure all required input fields are provided and valid.
    • Check API documentation for error codes and adjust inputs accordingly.

Links and References

  • Refer to your device management platform’s API documentation for details on the /api/pt/devices/standalone endpoint.
  • n8n HTTP Request node documentation for understanding how HTTP calls are made within nodes: https://docs.n8n.io/nodes/n8n-nodes-base.httpRequest/

Discussion