Send Message
Comprehensive guide to sending various types of messages and managing message interactions via WhatsApp
Overview
The Send Message module provides a complete set of methods for sending different types of content, managing message interactions, and controlling chat status indicators through WhatsApp. These methods allow you to create rich, interactive messaging experiences for your users.
Content Types
Send various types of content to engage your audience with multimedia and interactive elements.
Text Messages
Send simple text messages to your contacts.
Parameter | Type | Required | Description |
---|---|---|---|
message | string | Yes | The text content of the message |
contact | string | Yes | The WhatsApp contact ID in the format โxxx@c.usโ |
Text messages support markdown formatting for bold, italic, strikethrough, and code blocks
.
Image Messages
Share images with optional captions.
Parameter | Type | Required | Description |
---|---|---|---|
url | string | Yes | The URL of the image to send |
caption | string | No | Optional text caption for the image |
mimeType | string | No | The MIME type of the image (default: auto-detected) |
filename | string | No | Custom filename for the image |
Supported image formats include JPG, PNG, and WebP. Maximum file size is 16MB.
Location Messages
Share geographic locations with your contacts.
Parameter | Type | Required | Description |
---|---|---|---|
latitude | string | Yes | Latitude coordinate |
longitude | string | Yes | Longitude coordinate |
title | string | No | Name or description of the location |
Voice Messages
Send voice or audio recordings.
Parameter | Type | Required | Description |
---|---|---|---|
audioUrl | string | Yes | URL of the audio file |
Supported audio formats include MP3, OGG, and OPUS. For voice messages, OPUS format is recommended for best quality and compression.
Video Messages
Share videos with optional captions.
Parameter | Type | Required | Description |
---|---|---|---|
videoUrl | string | Yes | URL of the video file |
caption | string | No | Optional text caption for the video |
Supported video formats include MP4 and 3GP. Maximum file size is 16MB with a maximum duration of 3 minutes.
Polls
Create interactive polls to gather feedback from your contacts.
Parameter | Type | Required | Description |
---|---|---|---|
title | string | Yes | The question or title of the poll |
options | array | Yes | Array of answer options (2-12 options) |
isMultipleAnswer | boolean | No | Whether multiple options can be selected (default: false) |
Message Management
Control and interact with messages after theyโve been sent.
React to Messages
Add emoji reactions to messages.
Parameter | Type | Required | Description |
---|---|---|---|
messageId | string | Yes | ID of the message to react to |
reaction | string | Yes | Emoji to use as reaction |
To remove a reaction, set the reaction parameter to an empty string.
Star Messages
Mark important messages with a star for easy reference.
Parameter | Type | Required | Description |
---|---|---|---|
messageId | string | Yes | ID of the message to star/unstar |
starred | boolean | Yes | true to star, false to unstar |
Delete Messages
Remove sent messages from the chat.
Parameter | Type | Required | Description |
---|---|---|---|
messageId | string | Yes | ID of the message to delete |
Messages can only be deleted within a limited time window after sending (typically 1 hour for everyone, or anytime for โdelete for meโ).
Mark Messages as Seen
Indicate that a message has been read.
Parameter | Type | Required | Description |
---|---|---|---|
messageId | string | Yes | ID of the message to mark as seen |
Chat Status
Control typing indicators to provide a more natural conversation experience.
Start Typing Indicator
Show the typing indicator to the recipient.
The typing indicator automatically disappears after 25 seconds if not manually stopped.
Stop Typing Indicator
Hide the typing indicator.