# Send an order-update WhatsApp template
curl -X POST "https://api.2factor.in/v1/whatsapp/send" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+919876543210",
"template": "order_shipped",
"params": ["Meera","BC-8821","4-7pm"]
}'
// npm i @2factor/whatsapp
import Factor from "@2factor/whatsapp"
const wa = new Factor(process.env.API_KEY)
await wa.send({
to: "+919876543210",
template: "order_shipped",
params: ["Meera", "BC-8821", "4-7pm"]
})
# pip install twofactor-whatsapp
from twofactor import WhatsApp
wa = WhatsApp(api_key=os.environ["API_KEY"])
wa.send(
to="+919876543210",
template="order_shipped",
params=["Meera", "BC-8821", "4-7pm"]
)
// composer require twofactor/whatsapp
use TwoFactor\WhatsApp;
$wa = new WhatsApp(getenv("API_KEY"));
$wa->send([
"to" => "+919876543210",
"template" => "order_shipped",
"params" => ["Meera", "BC-8821", "4-7pm"]
]);