WhatsApp API
Send rich media messages and transactional notifications via WhatsApp Business API.
Send Message
POST
/messages/whatsappSends a WhatsApp message using a pre-approved template.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| to | string | Yes | The recipient phone number (E.164). |
| template_id | string | Yes | The ID of the approved template. |
| variables | object | No | Key-value pairs for template variables. |
Example Request
bash
curl -X POST https://api.devsecit.com/v1/messages/whatsapp \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+919876543210",
"template_id": "otp_verification_v2",
"variables": {
"code": "5678"
}
}'Example Response
json
{
"id": "msg_wa_456789123",
"status": "delivered",
"timestamp": "2023-10-27T10:05:00Z"
}