Front icon

Front

Interact with the Front API

Message → Download Attachment

AI-generated

Summary

Download file attachments from a Front message as binary data, either by direct attachment URL or by message ID with optional all-download and PDF filtering.

Inputs

  • downloadSource — Whether to download from a message ID or a direct attachment URL
  • attachmentUrl (required) — The full URL of the attachment to download (from a message's attachments array)
  • filename — The filename to use for the downloaded file
  • messageId (required) — The ID of the message containing the attachment
  • downloadAll — Whether to download all attachments from the message
  • attachmentId (required) — The ID of the specific attachment to download
  • options — Additional download options (binaryProperty, onlyPdfs)

Output shape

Returns one or more items. When downloadSource is 'attachmentUrl', returns a single item with JSON {filename, url} and binary data under the specified binaryProperty. When downloadSource is 'messageId', returns one result item per downloaded attachment, each containing JSON {attachmentId, filename, contentType, size} and binary data under a property name that is binaryProperty if a single attachment, or ${binaryProperty}_${index} for multiple. If no attachments match the criteria, returns an error JSON.

The binaryProperty parameter defaults to 'data' and is written to the node's binary output. The onlyPdfs filter only applies when downloadAll is true and downloadSource is 'messageId'.

Examples

Example 1: Download a single attachment by URL

downloadSource=attachmentUrl, attachmentUrl=https://example.com/file.pdf, filename=report.pdf

Example 2: Download all PDF attachments from a message

downloadSource=messageId, messageId=msg_123, downloadAll=true, onlyPdfs=true

Links

Discussion