WhatsApp Business API — Send Rich Messages & Templates | BulkSMS.ca
Complete REST API for WhatsApp Business. Send template messages, rich media, interactive buttons, and manage conversations at scale.
Base URL: https://api.bulksms.ca
What is the WhatsApp Business API?
The WhatsApp Business API is an official messaging channel that allows businesses to send and receive messages at scale. Unlike the WhatsApp Business App, the API supports template messages, rich media (images, video, documents), interactive buttons, chatbots, and multi-agent support. Messages are sent via REST API with API key authentication, and webhook notifications provide real-time delivery and read receipts.
Authentication
Authorization: Bearer YOUR_API_KEY
Content-Type: application/jsonInclude your API key in the Authorization header of every request. API keys are available in your BulkSMS.ca dashboard under Settings > API Keys.
API Endpoints
/v2/whatsapp/sendSend a WhatsApp template message.
Auth: API Key{
"to": "9198XXXXXXXX",
"template": "order_confirmation",
"language": "en",
"params": ["John", "ORD12345"]
}{
"status": "success",
"message_id": "wa_msg_001",
"conversation_id": "conv_abc"
}/v2/whatsapp/send-textSend a text message (within 24h session).
Auth: API Key{
"to": "9198XXXXXXXX",
"message": "Hello! How can we help you today?"
}{
"status": "success",
"message_id": "wa_msg_002"
}/v2/whatsapp/send-mediaSend an image, video, or document.
Auth: API Key{
"to": "9198XXXXXXXX",
"type": "image",
"url": "https://example.com/image.jpg",
"caption": "Check out our new collection!"
}{
"status": "success",
"message_id": "wa_msg_003",
"media_id": "media_001"
}/v2/whatsapp/send-buttonsSend an interactive button message.
Auth: API Key{
"to": "9198XXXXXXXX",
"body": "Would you like to proceed?",
"buttons": [
{ "id": "yes", "title": "Yes" },
{ "id": "no", "title": "No" }
]
}{
"status": "success",
"message_id": "wa_msg_004"
}/v2/whatsapp/templatesList approved WhatsApp templates.
Auth: API Key{
"templates": [
{ "name": "order_confirmation", "status": "approved", "language": "en" }
]
}/v2/whatsapp/webhookConfigure webhook URL for incoming messages.
Auth: API Key{
"url": "https://your-app.com/webhook",
"events": ["message.received", "message.read"]
}{
"status": "success",
"webhook_id": "wh_001"
}SDK Code Examples
curl (built-in)curl -X POST https://api.bulksms.ca/v2/whatsapp/send \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "9198XXXXXXXX",
"template": "order_confirmation",
"language": "en",
"params": ["John", "ORD12345"]
}'npm install axiosconst axios = require('axios');
// Send template
await axios.post('https://api.bulksms.ca/v2/whatsapp/send', {
to: '9198XXXXXXXX',
template: 'order_confirmation',
language: 'en',
params: ['John', 'ORD12345']
}, { headers: { Authorization: 'Bearer YOUR_API_KEY' }});
// Handle incoming webhook
app.post('/webhook', (req, res) => {
console.log('Message from:', req.body.from);
console.log('Text:', req.body.message);
res.sendStatus(200);
});pip install requestsimport requests
response = requests.post("https://api.bulksms.ca/v2/whatsapp/send",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"to": "9198XXXXXXXX",
"template": "order_confirmation",
"language": "en",
"params": ["John", "ORD12345"]
}
)
print(response.json())composer require guzzlehttp/guzzle$client = new GuzzleHttp\Client();
$response = $client->post('https://api.bulksms.ca/v2/whatsapp/send', [
'headers' => ['Authorization' => 'Bearer YOUR_API_KEY'],
'json' => [
'to' => '9198XXXXXXXX',
'template' => 'order_confirmation',
'language' => 'en',
'params' => ['John', 'ORD12345']
]
]);
echo $response->getBody();Webhooks
Configure webhooks in your dashboard to receive real-time event notifications.
Supported Events
{
"event": "message.received",
"from": "9198XXXXXXXX",
"message_id": "wa_msg_005",
"type": "text",
"body": "I want to place an order",
"timestamp": "2026-06-15T14:30:22+05:30"
}Error Codes
FAQs
What is a WhatsApp template message?
Template messages are pre-approved message formats that businesses can send to customers who have opted in. They can include variables, media headers, and interactive buttons.
Can I send free-form messages?
Free-form (session) messages can only be sent within a 24-hour window after the customer last messaged you. Outside this window, you must use approved templates.
What media types are supported?
WhatsApp API supports images (JPEG, PNG), video (MP4), audio (MP3, OGG), documents (PDF), and stickers.
How do I get templates approved?
Submit templates through your BSP dashboard. Meta reviews templates within 24-48 hours. Templates must follow WhatsApp guidelines.
What is conversation-based pricing?
WhatsApp charges per conversation (24-hour session), not per message. User-initiated conversations cost less than business-initiated ones.