AvantGuard - WebhookSite icon

AvantGuard - WebhookSite

AvantGuard - WebhookSite

Actions100

Overview

This node operation creates a new asset under a specified company by sending a POST request to the API endpoint for company assets. It is useful in scenarios where you need to programmatically add asset records linked to a particular company, such as inventory management, asset tracking, or IT equipment registration.

For example, if you manage multiple companies and want to automate adding new hardware assets (like laptops or servers) associated with each company, this node operation allows you to specify the company ID and asset details to create these records efficiently.

Properties

Name Meaning
Company Id The identifier of the parent company for the new asset (number).
Additional Body Fields Optional fields to provide more details about the asset:
- Name The name of the new asset (string).
- Asset Layout Id The identifier of the asset layout associated with the new asset (number).
- Primary Serial The primary serial number of the new asset (string).
- Primary Mail The primary email associated with the new asset (string).
- Primary Model The primary model of the new asset (string).
- Primary Manufacturer The primary manufacturer of the new asset (string).
- Custom Fields An array of JSON objects representing custom fields, with labels underscored and downcased.

Output

The node outputs the JSON response from the API after creating the asset. This typically includes the newly created asset's details such as its unique ID, associated company ID, and any other metadata returned by the API.

If the API supports binary data output related to the asset (e.g., attachments), it would be included accordingly, but based on the provided code and properties, the output is primarily JSON data representing the created asset.

Dependencies

  • Requires an API key or authentication token configured in n8n credentials to authorize requests to the external service managing companies and assets.
  • The node depends on the external API endpoint that accepts POST requests to create assets under a given company.
  • Proper base URL configuration for the API must be set in the node credentials or environment variables.

Troubleshooting

  • Missing or invalid Company Id: Ensure the Company Id property is provided and corresponds to an existing company; otherwise, the API may return an error indicating the company was not found.
  • Invalid additional fields: If custom fields or other optional body fields are malformed (e.g., invalid JSON in custom fields), the API might reject the request. Validate JSON syntax before submission.
  • Authentication errors: Verify that the API key or authentication token is correctly configured and has sufficient permissions to create assets.
  • API endpoint errors: Network issues or incorrect base URL settings can cause failures. Confirm connectivity and correct API endpoint configuration.

Links and References

  • Refer to the external API documentation for detailed information on asset creation endpoints and required/requested fields.
  • Consult n8n documentation on how to configure API credentials and use collection-type input properties.

Discussion