Appearance
Send Text Message
Send a plain text message to a specific WhatsApp number.
Endpoint
http
POST /whatsapp/send-text/:instance- :instance: The name of your WhatsApp instance (e.g.,
my-bot).
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
recipient | string | Yes | The recipient's WhatsApp number with country code (e.g., 254123456789). |
text | string | Yes | The message content you want to send. |
Example Payload
json
{
"recipient": "254123456789",
"text": "Hello! This is a test message from ChatBreeZ API."
}Examples
bash
curl -X POST https://api.chatbreez.com/whatsapp/send-text/my-instance \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"recipient": "254123456789",
"text": "Hello from ChatBreeZ!"
}'javascript
const axios = require('axios');
const sendMessage = async () => {
try {
const response = await axios.post('https://api.chatbreez.com/whatsapp/send-text/my-instance', {
recipient: '254123456789',
text: 'Hello from ChatBreeZ!'
}, {
headers: {
'X-API-Key': 'your_api_key'
}
});
console.log(response.data);
} catch (error) {
console.error(error);
}
};
sendMessage();