InboundMessage¶
This docs was updated at: 2026-02-23
com.paragon.messaging.whatsapp.payload.InboundMessage ยท Interface
Sealed interface for inbound WhatsApp webhook messages.
These are messages received FROM WhatsApp users TO the application via the Meta WhatsApp
Business API webhook. For outbound messages sent to users, see com.paragon.messaging.core.OutboundMessage.
Supported Inbound Message Types¶
TextMessage- Plain text messagesImageMessage- Image attachmentsVideoMessage- Video attachmentsAudioMessage- Voice messages and audio filesDocumentMessage- Document/file attachmentsStickerMessage- Sticker messagesInteractiveMessage- Button and list repliesLocationMessage- Shared locationsReactionMessage- Emoji reactionsSystemMessage- System notificationsOrderMessage- Commerce order messages
JSON Deserialization¶
This interface uses Jackson polymorphic type handling to automatically deserialize webhook
payloads to the correct message type based on the type field.
Since: 2.1
Methods¶
from¶
Returns the sender's WhatsApp ID (phone number).
Returns
the sender's WhatsApp ID
id¶
Returns the unique message ID assigned by WhatsApp.
This ID can be used for:
- Message deduplication
- Replying to specific messages
- Sending reactions
- Tracking delivery status
Returns
the unique message ID
timestamp¶
Returns the message timestamp (Unix epoch seconds).
Returns
the message timestamp
type¶
Returns the message type identifier.
Common values: "text", "image", "video", "audio", "document", "sticker", "interactive", "location", "reaction", "system", "order"
Returns
the message type
context¶
Returns the message context if this is a reply to another message.
The context contains information about the quoted message, including its ID and whether it was forwarded.
Returns
the message context, or null if not a reply
extractTextContent¶
Extracts the primary text content from this inbound message.
For non-text messages, returns a descriptive placeholder:
- Text: Returns the message body
- Image/Video: Returns caption or "[Image]"/"[Video]"
- Audio: Returns "[Audio message]"
- Location: Returns "[Location]"
- Interactive: Returns button/list selection
Returns
extracted text content for AI processing
isReply¶
Checks if this message is a reply to another message.
Returns
true if this message has reply context
repliedToMessageId¶
Returns the ID of the message this is replying to, if any.
Returns
the replied message ID, or null