Skip to content
  • Auto
  • Light
  • Dark
Download Beeper

Download

Download an attachment
client.messages.attachments.download(AttachmentDownloadParamsbody, RequestOptionsoptions?): AttachmentDownloadResponse
post/v0/download-attachment

Download an attachment from a message and return the local file path

ParametersExpand Collapse
body: AttachmentDownloadParams
chatID: string

Unique identifier of the chat (supports both chatID and localChatID).

messageID: string

The message ID (eventID) containing the attachment.

ReturnsExpand Collapse
AttachmentDownloadResponse { success, error, filePath }
success: boolean

Whether the attachment was successfully downloaded.

error?: string

Error message if the download failed.

filePath?: string

Local file system path to the downloaded attachment.

import BeeperDesktop from '@beeper/desktop-api';

const client = new BeeperDesktop({
  accessToken: 'My Access Token',
});

const response = await client.messages.attachments.download({
  chatID: '!NCdzlIaMjZUmvmvyHU:beeper.com',
  messageID: 'messageID',
});

console.log(response.success);
{
  "success": true,
  "error": "error",
  "filePath": "filePath"
}
Returns Examples
{
  "success": true,
  "error": "error",
  "filePath": "filePath"
}