Skip to content
  • Auto
  • Light
  • Dark
Download Beeper

Download Asset

Download an asset
client.DownloadAsset(ctx, body) (*DownloadAssetResponse, error)
post/v1/download-asset

Download a Matrix asset using its mxc:// or localmxc:// URL and return the local file URL.

ParametersExpand Collapse
body DownloadAssetParams
URL param.Field[string]

Matrix content URL (mxc:// or localmxc://) for the asset to download.

minLength1
ReturnsExpand Collapse
type DownloadAssetResponse struct{…}
Error stringoptional

Error message if the download failed.

SrcURL stringoptional

Local file URL to the downloaded asset.

Download an asset
package main

import (
  "context"
  "fmt"

  "github.com/beeper/desktop-api-go"
  "github.com/beeper/desktop-api-go/option"
)

func main() {
  client := beeperdesktopapi.NewClient(
    option.WithAccessToken("My Access Token"),
  )
  response, err := client.DownloadAsset(context.TODO(), beeperdesktopapi.DownloadAssetParams{
    URL: "mxc://example.org/Q4x9CqGz1pB3Oa6XgJ",
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Error)
}
{
  "error": "error",
  "srcURL": "srcURL"
}
Returns Examples
{
  "error": "error",
  "srcURL": "srcURL"
}