Send WhatsApp
Send WhatsApp messages including text, media, and template messages through the WhatsApp Business API. Support for rich media content, interactive buttons, and delivery confirmations.
Headers
- Authorization:
Bearer YOUR_API_KEY
- Content-Type:
application/json
Body Parameters
to_phone
Required - Phone number in international format (e.g., +263771234567). For bulk WhatsApp, provide an array of phone numbers.
message
Optional - Plain text message content. Required if not using template_name.
template_name
Optional - Name of approved WhatsApp template to use.
template_data
Optional - Object containing template variable values.
media_url
Optional - URL of media file to send (image, video, document).
provider
Optional - WhatsApp provider to use ("meta", "twilio"). Defaults to "meta".
Sample Requests
Send Text Message
curl -X POST https://api.ping.co.zw/v1/notification/api/whatsapp/send \ -H "Authorization: Bearer sk_test_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "to_phone": "+263771234567", "message": "Hello from Ping! Your order has been confirmed.", "provider": "meta" }'
Sample Responses
Successful WhatsApp Send
{ "result": "success", "message": "WhatsApp message sent successfully", "environment": "test", "details": { "status": "success", "message_id": "wamid.HBgNMjYzNzcxMjM0NTY3FQA...", "provider": "meta" } }
WhatsApp Requirements
- Business Verification: WhatsApp Business API requires business verification
- Template Approval: Marketing templates must be pre-approved by WhatsApp
- 24-Hour Window: Free-form messages only allowed within 24 hours of customer contact
- Media Limits: Images (5MB), Videos (16MB), Documents (100MB)