Skip to content
Download Beeper

Add a reaction

client.Chats.Messages.Reactions.Add(ctx, messageID, params) (*ChatMessageReactionAddResponse, error)
POST/v1/chats/{chatID}/messages/{messageID}/reactions

Add a reaction to an existing message.

ParametersExpand Collapse
messageID string

Message ID.

params ChatMessageReactionAddParams
ChatID param.Field[string]

Path param: Chat ID. Input routes also accept the local chat ID from this installation when available.

ReactionKey param.Field[string]

Body param: Reaction key to add (emoji, shortcode, or custom emoji key)

minLength1
TransactionID param.Field[string]Optional

Body param: Optional transaction ID for deduplication and send tracking

ReturnsExpand Collapse
type ChatMessageReactionAddResponse struct{…}
ChatID string

Chat ID. Input routes also accept the local chat ID from this installation when available.

MessageID string

Message ID.

ReactionKey string

Reaction key that was added.

Success bool

Always true. Indicates the reaction was queued; failures return an error response.

TransactionID string

Transaction ID used for send tracking.

Add a reaction

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.Chats.Messages.Reactions.Add(
    context.TODO(),
    "1343993",
    beeperdesktopapi.ChatMessageReactionAddParams{
      ChatID: "!NCdzlIaMjZUmvmvyHU:beeper.com",
      ReactionKey: "x",
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.ChatID)
}
{
  "chatID": "!whatsapp_15550101002:ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc.local-whatsapp.localhost",
  "messageID": "1343993",
  "reactionKey": "❤️",
  "success": true,
  "transactionID": "txn_v3a8f4c9d2e1"
}
Returns Examples
{
  "chatID": "!whatsapp_15550101002:ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc.local-whatsapp.localhost",
  "messageID": "1343993",
  "reactionKey": "❤️",
  "success": true,
  "transactionID": "txn_v3a8f4c9d2e1"
}