Salesforce WhatsApp Integration
Send WhatsApp Business messages from Salesforce using Apex HTTP callouts to the Zaptilo API. Trigger from Lead, Contact, Opportunity, or Case events — or call from a Lightning component, Flow, or Process Builder. Built for Indian enterprises running Salesforce who need WhatsApp delivery without paying per-user CPaaS fees.
Why Zaptilo for Salesforce in India?
- Pay-as-you-go pricing in INR — from ₹0.04/message at volume
- One Zaptilo account serves your entire Salesforce org — no per-user fees
- India-based support, GST invoice for Indian entities
- Works with Salesforce Sales Cloud, Service Cloud, and Marketing Cloud Account Engagement
Step 1: Add Remote Site Setting
Salesforce blocks outbound HTTP by default. Whitelist Zaptilo:
Salesforce > Setup > Remote Site Settings > New
Remote Site Name: Zaptilo
Remote Site URL: https://web.zaptilo.aiStep 2: Create the Apex class
Save this in Setup → Apex Classes → New:
public class ZaptiloWhatsApp {
private static final String BASE_URL = 'https://web.zaptilo.ai';
private static final String TOKEN = 'YOUR_ZAPTILO_API_TOKEN';
public static void sendTemplate(String phone, String templateName, List<String> bodyValues) {
Http http = new Http();
HttpRequest req = new HttpRequest();
req.setEndpoint(BASE_URL + '/api/send/template');
req.setMethod('POST');
req.setHeader('Authorization', 'Bearer ' + TOKEN);
req.setHeader('Content-Type', 'application/json');
List<Map<String, String>> params = new List<Map<String, String>>();
for (String v : bodyValues) {
params.add(new Map<String, String>{ 'type' => 'text', 'text' => v });
}
Map<String, Object> body = new Map<String, Object>{
'phone' => phone,
'template' => new Map<String, Object>{
'name' => templateName,
'language' => new Map<String, String>{ 'code' => 'en' },
'components' => new List<Object>{
new Map<String, Object>{ 'type' => 'body', 'parameters' => params }
}
}
};
req.setBody(JSON.serialize(body));
HttpResponse res = http.send(req);
System.debug('Zaptilo response: ' + res.getBody());
}
}For production, store the API token in a Custom Setting or Named Credential, never hard-coded.
Step 3: Trigger from a Lead trigger
// Trigger on Lead create
trigger LeadWhatsAppTrigger on Lead (after insert) {
for (Lead l : Trigger.new) {
if (l.Phone != null) {
ZaptiloWhatsApp.sendTemplate(
'91' + l.Phone.replaceAll('\\D', ''),
'lead_welcome',
new List<String>{ l.FirstName, l.Company }
);
}
}
}Step 4: Call from Salesforce Flow
Wrap the Apex method in an @InvocableMethod annotation and call it from any Salesforce Flow. This lets non-developers add WhatsApp steps to record-triggered or scheduled flows.
Use cases for Indian Salesforce orgs
Lead capture welcome
Auto-message new leads from web-to-lead forms.
Opportunity stage alerts
WhatsApp customer when deal moves to closed-won.
Case creation notify
Send case ID + ETA when a new support case is logged.
Quote/proposal share
WhatsApp PDF quote attachments to decision-makers.
Renewal reminders
Schedule WhatsApp 30/15/7 days before contract end.
Field service updates
Notify customer of technician arrival window.
Frequently asked questions
How do I send WhatsApp messages from Salesforce?
Create an Apex class that uses Http and HttpRequest to POST to the Zaptilo /api/send/template endpoint with a Bearer token. Add web.zaptilo.ai as a Remote Site Setting first, then call the class from triggers, Lightning components, Flows, or invocable methods.
Does this work with Salesforce Sales Cloud and Service Cloud?
Yes. The Apex pattern works in any Salesforce org — Sales Cloud, Service Cloud, Marketing Cloud Account Engagement, and even Government Cloud. No special edition required beyond Apex/API access.
Can I trigger WhatsApp from Salesforce Flow without writing Apex?
Yes. Wrap the Apex method with the @InvocableMethod annotation and the method becomes available as a Flow action. Non-developers can then drop it into record-triggered flows or scheduled flows.
Are there per-user fees for Salesforce WhatsApp integration with Zaptilo?
No. One Zaptilo account serves your entire Salesforce org. Pricing is per message in INR (from ₹0.04/message at volume), not per Salesforce seat.
Add WhatsApp to your Salesforce org
Free signup. INR pricing. GST invoice. No per-user fees.
Get Started Free