A separate, dedicated API from our SMS endpoints — WhatsApp works differently under the hood: pre-approved templates instead of free text, and explicit recipient consent required on every send. This page covers exactly what you need.
Every request must include consent: "yes" — meaning you've genuinely confirmed the recipient agreed to be contacted on WhatsApp. Sending without real consent risks WhatsApp restricting or banning the shared account for every customer, not just yours. This is enforced server-side; there is no way to bypass it.
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://yoolasms.com/api/v1/send-whatsapp',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
"api_key": "YOUR_API_KEY_HERE",
"phone": "256704487563",
"template_name": "yoola_otp_verification",
"template_params": ["482913"],
"consent": "yes"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
# Yoola SMS API - Send WhatsApp Message (cURL)
curl --location 'https://yoolasms.com/api/v1/send-whatsapp' \
--header 'Content-Type: application/json' \
--data '{
"api_key": "YOUR_API_KEY_HERE",
"phone": "256704487563",
"template_name": "yoola_otp_verification",
"template_params": ["482913"],
"consent": "yes"
}'
# Yoola SMS API - Send WhatsApp Message (Python)
import requests
url = "https://yoolasms.com/api/v1/send-whatsapp"
payload = {
"api_key": "YOUR_API_KEY_HERE",
"phone": "256704487563",
"template_name": "yoola_otp_verification",
"template_params": ["482913"],
"consent": "yes"
}
response = requests.post(url, json=payload)
print(response.text)
Base URL: https://yoolasms.com/api/v1/
api_key, phone, template_name, template_params (array), consent (must be the literal string "yes"). Returns 202 with "status":"queued" automatically for sends to more than 20 recipients — no separate call needed, it's handled for you.WhatsApp requires every business-initiated message to use a pre-approved template — you can't send arbitrary free text the way you can with SMS. Use the exact template_name values below; anything else is rejected before it ever reaches WhatsApp.
template_params can be an empty array []. Can be sent to multiple recipients at once, since there's nothing to personalize.["482913"]. Single recipient only — sending an OTP to multiple numbers in one call would give everyone the same code, so this is rejected server-side.["James"]. Single recipient only, same reasoning as above. For sending this to many recipients with each getting their own name, use the personalized-send option below instead.Need a template that isn't listed here?
New templates must be submitted to and approved by Meta before they can be used — this isn't something we can create instantly on request, and there's no way for a developer to submit their own template directly. Real approval typically takes anywhere from a few minutes to 24 hours once submitted. Tell us what you need and we'll get it built and approved.
Request a New TemplateFor templates with variables (like the OTP or promo templates above), a single API call is restricted to one recipient — otherwise everyone would receive identical values. To message many recipients where each gets their own name, code, or amount, use the dashboard's Personalized WhatsApp Campaign feature (CSV upload, one row per recipient) rather than this direct API for now.