Sends a text message to a WhatsApp user using the Rampwin messaging API.
Endpoint
POST /api/messages/send
Base URL
https://api.rampwin.com
Description
This API allows you to send simple text messages to users on WhatsApp within the active session window.
When to Use
Use this API when you want to:
- Send normal chat messages
- Reply to users within the 24-hour session window
- Send conversational or support messages
Authentication
- API Key
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| dontShowInChatList | boolean | No | Hide message from chat list (default: false) |
Headers
| Header | Type | Required | Description |
|---|---|---|---|
| X-API-Key | string | Yes | Your Rampwin API key |
| Content-Type | string | Yes | application/json |
| Cookie | string | Yes | AWS session cookie |
Request Body
{
"channel_id": "CHANNEL_ID",
"phone_number": "PHONE_NUMBER",
"hide_from_chat": false,
"text": "Hello"
}
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| channel_id | string | Yes | WhatsApp channel ID |
| phone_number | string | Yes | Recipient phone number (with country code) |
| hide_from_chat | boolean | No | Hide message in chat UI |
| text | string | Yes | Message content |
Example Request
curl --location 'https://api.rampwin.com/api/messages/send?dontShowInChatList=false' \
--header 'X-API-Key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"channel_id": "YOUR_CHANNEL_ID",
"phone_number": "YOUR_MOBILE_NUMBER",
"hide_from_chat": false,
"text": "Hello"
}'
Response
Success (200)
{
"success": true,
"message": "Message sent successfully"
}
Error (400)
{
"success": false,
"message": "Invalid request payload"
}
Common Errors
| Error | Description |
|---|---|
| Invalid API Key | Authentication failed |
| Missing parameters | Required fields not provided |
| Invalid phone number | Incorrect format |
| Session expired | Outside 24-hour messaging window |
