Skip to content
Download Beeper

Download a file

client.assets.download(AssetDownloadParams { url } body, RequestOptionsoptions?): AssetDownloadResponse { error, srcURL }
POST/v1/assets/download

Download a file from an mxc:// or localmxc:// URL to the device running the Beeper Client API and return the local file URL.

ParametersExpand Collapse
body: AssetDownloadParams { url }
url: string

Beeper media URL (mxc:// or localmxc://) for the file to download.

minLength1
ReturnsExpand Collapse
AssetDownloadResponse { error, srcURL }
error?: string

Error message if the download failed.

srcURL?: string

Local file URL to the downloaded file.

Download a file

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

const client = new BeeperDesktop({
  accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted
});

const response = await client.assets.download({ url: 'mxc://example.org/Q4x9CqGz1pB3Oa6XgJ' });

console.log(response.error);
{
  "error": "error",
  "srcURL": "srcURL"
}
Returns Examples
{
  "error": "error",
  "srcURL": "srcURL"
}