Overview
WhatsApp template messages are pre-approved message formats that allow businesses to send notifications and initiate conversations with users. This guide covers all the ways to send template messages through Kapso, including support for various template types and parameter formats.Sending Templates via API
Basic Template Message
Send a simple text template with positional parameters:Named Parameters
For templates using named parameters (e.g.,\{\{customer_name\}\}, \{\{order_id\}\}):
Templates with Headers
Text Header with Parameter
For headers with dynamic text like “Welcome {{customer_name}}!” or “Welcome {{1}}!”: For templates with positional parameters:WhatsApp headers support only ONE parameter. The
header_params field accepts either:- A single string value (e.g.,
"John Smith") - For named parameter templates, you can also use a hash with the parameter name (e.g.,
{"name": "John Smith"})
Image Header
Video Header
Document Header
Templates with Location Headers
Send a template with a location header:Templates with Interactive Buttons
URL Buttons with Dynamic Parameters
Quick Reply Buttons
Copy Code Buttons
Complete Example with All Features
Here’s a comprehensive example combining headers, body parameters, and buttons:Sending Templates with Flows
Flows provide a powerful way to send template messages as part of automated workflows. When configuring a Send Template action in a flow, you specify the parameters in the “Parameters” field.Structured Parameters Format
All Send Template actions in flows use the structured format with specific parameter keys. This provides consistent support for all template features including headers, buttons, and advanced components.Basic Structured Format
For Simple Text Templates
For templates with only body parameters (positional):For Templates with Advanced Features
To configure headers, buttons, and other features, add the corresponding keys:Flow Parameter Examples
Text Header with Parameter
For a template with header text “Welcome {{1}}!” (positional) or “Welcome {{name}}!” (named) and body parameters: Positional parameters:Remember:
header_params accepts either a single string value or a hash with the parameter name. Flow variables like \{\{customer_name\}\} will be substituted before sending.Order Confirmation with Image Header and Tracking Button
For a template with image header, body text, and a URL button with dynamic parameter:Appointment Reminder with Location
For a template with location header and quick reply buttons:Promotional Message with Copy Code
For a marketing template with image header and copy code button:Document Header with Filename
For templates with document headers:Simple Text Template
For templates with only text parameters (most common case):Parameter Types Reference
Template Body Parameters
Header Parameters
Button Parameters
Button indices (0, 1, 2, etc.) correspond to the order of buttons defined in your template.

