WhatsApp Notifications
Send WhatsApp messages to customers for notifications, customer service, and marketing campaigns via the Ping API.
The WhatsApp model
The WhatsApp notification model contains all the information about WhatsApp messages sent through the Ping platform.
Properties
- Name
public_id- Type
- string
- Description
Unique identifier for the WhatsApp notification.
- Name
to_phone- Type
- string
- Description
Recipient phone number in E.164 international format (e.g., +263771234567).
- Name
message- Type
- string
- Description
WhatsApp message content (text messages only within 24-hour customer service window).
- Name
template_name- Type
- string
- Description
WhatsApp template name (required for messages outside the 24-hour window).
- Name
template_data- Type
- object
- Description
Variables for template personalization.
- Name
status- Type
- string
- Description
Delivery status:
sent,delivered,read,failed.
- Name
wa_message_id- Type
- string
- Description
WhatsApp Business API message ID for tracking.
- Name
created_at- Type
- timestamp
- Description
Timestamp of when the message was created.
Send WhatsApp message
Send a WhatsApp message to one or multiple recipients. Free-form text messages can only be sent within the 24-hour customer service window. For messages outside this window, use an approved template.
Required headers
- Name
X-Ping-Api-Key- Type
- string
- Description
Your API key with
whatsapppermission.
- Name
Content-Type- Type
- string
- Description
Must be
application/json.
Required attributes
- Name
to_phone- Type
- string | array
- Description
Recipient phone number or array of phone numbers in E.164 format (e.g., "+263771234567").
- Name
message- Type
- string
- Description
WhatsApp message content (for free-form text messages).
Optional attributes
- Name
media_url- Type
- string
- Description
URL to media file (image, video, document, audio) to send with the message.
- Name
interactive- Type
- object
- Description
Send an interactive message (buttons or list) instead of plain text. See Send interactive message for details.
- Name
recipient_group_id- Type
- string
- Description
Send to all members of a recipient group instead of individual phone numbers.
Request
curl -X POST https://api.ping.co.zw/v1/notification/api/whatsapp/send \
-H "X-Ping-Api-Key: pk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"to_phone": "+263771234567",
"message": "Your order #12345 has been shipped!"
}'
Response
{
"result": "success",
"message": "WhatsApp message sent successfully",
"wa_message_id": "wamid.HBgLMjYzNzcxMjM0NTY3FQIAERgSQUIyM0Y0NTY3ODkwQUJDRAA"
}
Send interactive message
Send an interactive WhatsApp message with reply buttons (max 3) or a list menu (max 10 items). Interactive messages give recipients tappable options instead of requiring them to type a response.
Required headers
- Name
X-Ping-Api-Key- Type
- string
- Description
Your API key with
whatsapppermission.
- Name
Content-Type- Type
- string
- Description
Must be
application/json.
Required attributes
- Name
to_phone- Type
- string
- Description
Recipient phone number in E.164 format.
- Name
interactive- Type
- object
- Description
Interactive message configuration. Must include
type,body, and type-specific fields.
Interactive object
- Name
type- Type
- string
- Description
Either
buttons(reply buttons) orlist(list menu).
- Name
body- Type
- string
- Description
Message body text (max 1024 characters).
- Name
header- Type
- string
- Description
Optional header text (max 60 characters).
- Name
footer- Type
- string
- Description
Optional footer text (max 60 characters).
- Name
buttons- Type
- array
- Description
For
buttonstype only. Array of 1-3 button objects, each withid(string, max 256 chars) andtitle(string, max 20 chars).
- Name
button_text- Type
- string
- Description
For
listtype only. Text shown on the list menu button (max 20 chars).
- Name
sections- Type
- array
- Description
For
listtype only. Array of section objects, each withtitleandrows(array of row objects withid,title, and optionaldescription). Max 10 rows total across all sections.
Request
curl -X POST https://api.ping.co.zw/v1/notification/api/whatsapp/send \
-H "X-Ping-Api-Key: pk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"to_phone": "+263771234567",
"interactive": {
"type": "buttons",
"body": "Your order #12345 is ready for pickup. Would you like to confirm?",
"header": "Order Ready",
"footer": "Reply within 24 hours",
"buttons": [
{"id": "confirm_pickup", "title": "Confirm"},
{"id": "reschedule", "title": "Reschedule"},
{"id": "cancel_order", "title": "Cancel"}
]
}
}'
Response
{
"result": "success",
"message": "WhatsApp message sent successfully",
"wa_message_id": "wamid.HBgLMjYzNzcxMjM0NTY3FQIAERgSQUIyM0Y0NTY3ODkwQUJDRAA"
}
Send template message
Send a WhatsApp message using an approved template. Templates are required for messaging outside the 24-hour customer service window and support personalization through variables.
Required headers
- Name
X-Ping-Api-Key- Type
- string
- Description
Your API key with
whatsappandtemplatespermissions.
- Name
Content-Type- Type
- string
- Description
Must be
application/json.
Required attributes
- Name
to_phone- Type
- string
- Description
Recipient phone number in E.164 format.
- Name
template_name- Type
- string
- Description
Name of the approved WhatsApp template.
- Name
template_data- Type
- object
- Description
Template personalization data with language and component parameters.
Request
curl -X POST https://api.ping.co.zw/v1/notification/api/whatsapp/send \
-H "X-Ping-Api-Key: pk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"to_phone": "+263771234567",
"template_name": "order_update",
"template_data": {
"language": "en",
"components": [
{
"type": "body",
"parameters": [
{"type": "text", "text": "ORD-12345"},
{"type": "text", "text": "shipped"}
]
}
]
}
}'
Response
{
"result": "success",
"message": "Template message sent successfully",
"wa_message_id": "wamid.HBgLMjYzNzcxMjM0NTY3FQIAERgSQUIyM0Y0NTY3ODkwQUJDRAA"
}
List WhatsApp history
Retrieve a paginated list of WhatsApp messages sent through your account.
Required headers
- Name
X-Ping-Api-Key- Type
- string
- Description
Your API key.
Optional parameters
- Name
skip- Type
- integer
- Description
Number of records to skip (default: 0).
- Name
limit- Type
- integer
- Description
Maximum number of records to return (default: 50, max: 100).
Request
curl -G https://api.ping.co.zw/v1/notification/api/history/whatsapp \
-H "X-Ping-Api-Key: pk_live_your_api_key" \
-d limit=10 \
-d skip=0
Response
{
"result": "success",
"notifications": [
{
"public_id": "wa_abc123def456",
"recipient": "+263771234567",
"message": "Your order #12345 has been shipped!",
"template_name": null,
"status": "delivered",
"wa_message_id": "wamid.HBgLMjYzNzcxMjM0NTY3FQIAERgSQUIyM0Y0NTY3ODkwQUJDRAA",
"created_at": "2025-01-15T10:30:00Z"
}
],
"total": 1,
"skip": 0,
"limit": 10
}
Customer Service Window
WhatsApp enforces a 24-hour Customer Service Window (CSW) after a customer messages you. Within this window:
- ✅ Send free-form text messages
- ✅ Send media (images, videos, documents)
- ✅ No template required
- ✅ Free messaging (service category)
After the 24-hour window expires:
- ❌ Cannot send free-form text
- ✅ Must use approved templates only
- 💰 Charged per template category (utility, marketing, authentication)
Best Practice: Monitor conversation status and use templates for re-engagement after the CSW expires.
