Skip to content

feat: Add quoted reply support to POST /send/text (missing vs Evolution API v2) #27

@VictorNascimento14

Description

@VictorNascimento14

Feature Request: Quoted Reply (ContextInfo) Support

Summary

The Evolution API v2 (Node.js) supports quoted/reply messages via the quoted field on message-sending endpoints. Evolution Go does not expose this capability through its API — the POST /send/text endpoint only accepts number, text, and delay.

This means applications built on Evolution Go cannot trigger WhatsApp's native quoted reply card (the grey preview box above a message), even though whatsmeow (the underlying library) fully supports ContextInfo.


What's Missing

Evolution API v2 (Node.js) — ✅ Works

Endpoint: POST /message/sendText/{instance}

{
  "number": "5511999999999",
  "text": "Thanks for your message!",
  "quoted": {
    "key": {
      "id": "3EB0C5A277F7F9B6C599"
    },
    "message": {
      "conversation": "Original message text being replied to"
    }
  }
}

Result: WhatsApp renders the grey quoted card above the reply on both sides of the conversation.


Evolution Go — ❌ Not Supported

Endpoint: POST /send/text

{
  "number": "5511999999999",
  "text": "Thanks for your message!"
}

Only number, text, and delay are accepted. No quoted field. The /message/sendText and /message/sendText/{instance} paths return 404.


Endpoints That Support quoted in Evolution API v2

All of the following accept the same optional quoted object:

Endpoint Description
POST /message/sendText/{instance} Text message
POST /message/sendMedia/{instance} Image/video/document
POST /message/sendWhatsAppAudio/{instance} PTT audio
POST /message/sendSticker/{instance} Sticker
POST /message/sendList/{instance} List message

Proposed Change

Add optional quoted field to POST /send/text (and ideally /send/media, /send/audio) in Evolution Go:

{
  "number": "5511999999999",
  "text": "Thanks for your message!",
  "quoted": {
    "key": {
      "id": "3EB0C5A277F7F9B6C599"
    },
    "message": {
      "conversation": "Original message text"
    }
  }
}

When quoted is present, Evolution Go should construct proto.Message with the appropriate ContextInfo:

  • StanzaID = quoted.key.id
  • Participant = sender JID (derived from remoteJid + fromMe)
  • QuotedMessage = reconstructed from quoted.message

This maps directly to whatsmeow's existing support for quoted messages via client.SendMessage with a ContextInfo-enriched message.


Why This Matters

Without this feature, any product that migrates from Evolution API v2 to Evolution Go loses the ability to send quoted replies — a core WhatsApp UX pattern used heavily in customer support workflows.

Workaround: There is none via the current API. Falling back to plain text silently discards the reply context.


References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions