AvantGuard - Hudu icon

AvantGuard - Hudu

AvantGuard - Hudu

Actions109

Overview

The "Create Public Photo" operation for the "Public Photos" resource allows users to upload an image and associate it with a specific record (such as an Article) in the system. This node is useful when you need to programmatically attach public-facing images to records, such as adding photos to articles, products, or other entities that support photo associations.

Practical examples:

  • Automatically uploading user-submitted images to articles in a content management system.
  • Associating product photos with inventory items during bulk imports.
  • Adding event photos to event records from another workflow.

Properties

Name Type Meaning
Photo string The photo file to be uploaded (must be an image). This should reference a binary property containing the image data.
Record Type string The type of record the photo will be associated with (e.g., Article).
Record Id number The ID of the record the photo will be associated with.

Output

The node returns a JSON object representing the result of the photo upload. While the exact structure depends on the API response, typical fields may include:

  • An identifier for the uploaded photo.
  • Metadata about the photo (such as filename, size, URL).
  • Information about the associated record.

Example output:

{
  "id": 123,
  "filename": "photo.jpg",
  "url": "https://example.com/photos/123",
  "record_type": "Article",
  "record_id": 456,
  "created_at": "2024-06-01T12:34:56Z"
}

If the node supports binary output, it would represent the uploaded image or related binary data, but in this case, the main output is JSON metadata.

Dependencies

  • External Service: Requires access to the AvantGuard Hudu API.
  • API Key/Credentials: Needs valid avantguardHuduApi credentials configured in n8n, including the base URL (baseUrl) for the API.
  • n8n Configuration: Ensure the binary data (the image) is available in the input item under the specified property.

Troubleshooting

Common issues:

  • Missing or invalid credentials: If the required API credentials are not set up or are incorrect, the node will fail to authenticate.
  • Invalid photo input: If the "Photo" property does not reference a valid binary image, the upload will fail.
  • Record not found: If the provided "Record Id" does not exist for the given "Record Type", the API may return an error.
  • File size/type restrictions: The API may reject files that are too large or not recognized as images.

Common error messages and resolutions:

  • "Authentication failed": Check your API credentials and ensure they are correct.
  • "Invalid file format": Make sure the "Photo" property references a valid image file.
  • "Record not found": Verify that the "Record Type" and "Record Id" correspond to an existing record.

Links and References

Discussion