Axelor icon

Axelor

Consume Axelor API

Document Service → List Attachments

AI-generated

Overview

The Document Service - List Attachments operation in this n8n node retrieves a list of attachments associated with a specific domain model and record ID from the Axelor platform. This is useful for workflows that need to fetch all files or documents attached to a particular business object (such as a sale order, invoice, etc.) within Axelor.

Common scenarios:

  • Listing all documents attached to a sales order for review or processing.
  • Fetching supporting files linked to a customer or project record.
  • Automating document management tasks by integrating attachment data into other systems.

Practical example:
You have a workflow that processes sales orders and needs to download or analyze all files attached to each order. This operation allows you to retrieve the list of those attachments programmatically.


Properties

Name Type Meaning
Domain Models Resource Locator Selects the domain model (e.g., com.axelor.apps.sale.db.SaleOrder) to target.
ID Number The unique identifier of the specific element (record) whose attachments are listed.

Output

The output is a JSON array where each item represents an attachment related to the specified domain model and record ID. The structure of each item depends on the Axelor API response, but typically includes fields such as:

[
  {
    "id": 123,
    "fileName": "contract.pdf",
    "mimeType": "application/pdf",
    "size": 204800,
    "createdOn": "2024-06-01T12:34:56Z",
    // ...other metadata fields
  }
]
  • Each object contains metadata about an attachment (ID, file name, type, size, creation date, etc.).
  • No binary data is returned directly; only metadata/listing information.

Dependencies

  • External Service: Requires access to an Axelor instance with the DMS (Document Management System) module enabled.
  • API Credentials: Needs valid axelorApi credentials configured in n8n.
  • Environment: The Axelor API endpoint must be reachable from the n8n environment.

Troubleshooting

Common issues:

  • Invalid Domain Model or ID: If the domain model or ID does not exist, the node may return an empty list or an error.
  • Authentication Errors: Missing or incorrect API credentials will result in authentication failures.
  • Permission Denied: The user associated with the API key may lack permission to view attachments for the specified record.

Error messages and resolutions:

  • "404 Not Found": Check that the domain model and ID are correct and exist in Axelor.
  • "401 Unauthorized": Verify that the axelorApi credentials are set up correctly in n8n.
  • "403 Forbidden": Ensure the API user has sufficient permissions in Axelor.

Links and References

Discussion