Skip to content
Download Beeper

Upload an asset (base64)

client.Assets.UploadBase64(ctx, body) (*AssetUploadBase64Response, error)
POST/v1/assets/upload/base64

Upload a file using a JSON body with base64-encoded content. Returns an uploadID that can be referenced when sending messages with attachments. Alternative to the multipart upload endpoint.

ParametersExpand Collapse
body AssetUploadBase64Params
Content param.Field[string]

Base64-encoded file content (max ~500MB decoded)

minLength1
maxLength750000000
FileName param.Field[string]optional

Original filename. Generated if omitted

MimeType param.Field[string]optional

MIME type. Auto-detected from magic bytes if omitted

ReturnsExpand Collapse
type AssetUploadBase64Response struct{…}
Duration float64optional

Duration in seconds (audio/videos)

Error stringoptional

Error message if upload failed

FileName stringoptional

Resolved filename

FileSize float64optional

File size in bytes

Height float64optional

Height in pixels (images/videos)

MimeType stringoptional

Detected or provided MIME type

SrcURL stringoptional

Local file URL (file://) for the uploaded asset

UploadID stringoptional

Unique upload ID for this asset

Width float64optional

Width in pixels (images/videos)

Upload an asset (base64)

package main

import (
  "context"
  "fmt"

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

func main() {
  client := beeperdesktopapi.NewClient(

  )
  response, err := client.Assets.UploadBase64(context.TODO(), beeperdesktopapi.AssetUploadBase64Params{
    Content: "x",
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Width)
}
{
  "duration": 0,
  "error": "error",
  "fileName": "fileName",
  "fileSize": 0,
  "height": 0,
  "mimeType": "mimeType",
  "srcURL": "srcURL",
  "uploadID": "uploadID",
  "width": 0
}
Returns Examples
{
  "duration": 0,
  "error": "error",
  "fileName": "fileName",
  "fileSize": 0,
  "height": 0,
  "mimeType": "mimeType",
  "srcURL": "srcURL",
  "uploadID": "uploadID",
  "width": 0
}