Send a Message
In this quickstart, you'll learn how to send a template message using the WhatsApp Business API. Template messages allow you to initiate conversations with users when there has been no interaction in the past 24 hours.
Verify Template Availability
Before sending a template message, check that your template is approved and ready to use:
Confirm that your template shows a status of "APPROVED" in the response. Only templates with an active status can be sent to users.
Prepare Your Template Parameters
Most template messages contain variables (parameters) that need to be filled with specific information for each recipient.
For example, if your template is:
Identify the variables you need to replace:
{{1}}
will be the customer's name{{2}}
will be the order number
Make sure you have these values ready before sending your message.
Send Your Template Message
Use the /messages
endpoint to send your template message:
This sends the "order_confirmation" template to the specified phone number, replacing the variables with "Maria" and "B67890".
Check The Response
After sending your request, you'll receive a response containing a message ID:
Save this message ID to track the delivery status of your message.
Monitor Message Status
Set up a webhook endpoint in your application to receive message status updates. The webhook will receive notifications when the message is:
sent: Message has been sent from your WABA
delivered: Message has reached the recipient's device
read: Recipient has opened and read the message
failed: Message failed to send
A typical status webhook looks like this:
This webhook tells you that the message was delivered to the recipient's device.
Common Template Types
The simplest type of template with only text content and variables:
Best Practices
Send template messages at appropriate times based on the recipient's time zone
Use template parameters to personalize messages for each recipient
Monitor message delivery rates and adjust your strategy if delivery rates drop
For marketing templates, focus on making the first 5 lines engaging due to text truncation
Troubleshooting If your template message fails to send, check for these common issues:
Incorrect template name or namespace
Missing or incorrect parameters
Template has been paused or disabled due to poor quality rating
Recipient may have blocked messages from your business
Per-user marketing template limits may be in effect (error code 131049)
That's it! You've now sent your first template message using the WhatsApp Business API. For more information about template messages, see the Template Messages documentation.
Last updated
Was this helpful?