import { WhatsAppClient } from '@kapso/whatsapp-cloud-api';
const client = new WhatsAppClient({
baseUrl: 'https://api.kapso.ai/meta/whatsapp',
kapsoApiKey: process.env.KAPSO_API_KEY!
});
await client.messages.sendInteractiveList({
phoneNumberId: '647015955153740',
to: '15551234567',
bodyText: 'Choose your preferred delivery option',
buttonText: 'View options',
sections: [
{
title: 'Delivery',
rows: [
{ id: 'standard', title: 'Standard', description: '3-5 business days' },
{ id: 'express', title: 'Express', description: '1-2 business days' },
{ id: 'overnight', title: 'Overnight', description: 'Next day delivery' }
]
}
]
});
curl -X POST 'https://api.kapso.ai/meta/whatsapp/v24.0/647015955153740/messages' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"messaging_product": "whatsapp",
"to": "15551234567",
"type": "interactive",
"interactive": {
"type": "list",
"body": {
"text": "Choose your preferred delivery option"
},
"action": {
"button": "View options",
"sections": [
{
"title": "Delivery",
"rows": [
{
"id": "standard",
"title": "Standard",
"description": "3-5 business days"
},
{
"id": "express",
"title": "Express",
"description": "1-2 business days"
},
{
"id": "overnight",
"title": "Overnight",
"description": "Next day delivery"
}
]
}
]
}
}
}'

