TwentyDEV icon

TwentyDEV

Consume the Twenty API

Actions252

Overview

This node interacts with the "Attachments" resource of an API to retrieve a single attachment by its unique identifier. It is useful when you need to fetch detailed information about a specific attachment, including optionally related nested objects up to a specified depth level.

Common scenarios include:

  • Retrieving metadata or content details of a particular attachment stored in a system.
  • Fetching related data linked to the attachment, such as associated user info or parent objects, depending on the depth setting.
  • Integrating attachment data into workflows for processing, display, or further automation.

Example: You have an attachment ID from a previous step and want to get all its details along with directly related objects (depth=1) to display in a dashboard or use in conditional logic.

Properties

Name Meaning
Id The unique identifier of the attachment object to retrieve. This is required.
Depth Determines how many levels of nested related objects to include in the response:
- 0: Only the primary attachment's information.
- 1: The attachment plus its directly related objects (no further nesting).
- 2: The attachment, its directly related objects, and their related objects (two levels deep).

Output

The node outputs a JSON object representing the requested attachment. The structure includes the attachment's properties and, depending on the Depth parameter, nested related objects up to the specified level.

If the API supports binary data for attachments, this node may also output binary data representing the attachment content, but this is not explicitly shown in the provided code snippet.

Dependencies

  • Requires an API key credential to authenticate requests to the Twenty API.
  • The base URL for the API is configured via credentials.
  • The node uses the OpenAPI specification bundled internally to build request properties and handle communication.

Troubleshooting

  • Missing or invalid Id: The node requires a valid attachment ID; ensure it is provided and correctly formatted.
  • Authentication errors: Verify that the API key credential is set up properly and has necessary permissions.
  • Depth parameter misuse: Using a high depth value may result in large responses or slow performance; adjust according to needs.
  • Network or API errors: Check connectivity and API status if requests fail unexpectedly.

Links and References

Discussion