Skip to content
  • Auto
  • Light
  • Dark
Download Beeper

Send

Send a message
client.Messages.Send(ctx, chatID, body) (*MessageSendResponse, error)
post/v1/chats/{chatID}/messages

Send a text message to a specific chat. Supports replying to existing messages. Returns the sent message ID.

ParametersExpand Collapse
chatID string

Unique identifier of the chat.

body MessageSendParams
ReplyToMessageID param.Field[string]optional

Provide a message ID to send this as a reply to an existing message

Text param.Field[string]optional

Text content of the message you want to send. You may use markdown.

ReturnsExpand Collapse
type MessageSendResponse struct{…}
ChatID string

Unique identifier of the chat.

PendingMessageID string

Pending message ID

Send a message
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.Messages.Send(
    context.TODO(),
    "!NCdzlIaMjZUmvmvyHU:beeper.com",
    beeperdesktopapi.MessageSendParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response)
}
{
  "success": true,
  "error": "error",
  "chatID": "!signal_adamvy:local-signal.localhost",
  "pendingMessageID": "m1694783291234567"
}
Returns Examples
{
  "success": true,
  "error": "error",
  "chatID": "!signal_adamvy:local-signal.localhost",
  "pendingMessageID": "m1694783291234567"
}