Quick Start
Three steps to your first message from an external project. This page uses the platform's public API - auth is by x-api-key header, no OAuth on your side.
1Send your first message
Text messages only reach a customer inside the 24-hour service window (they must have messaged you within the last 24 h). For fresh sends, use an approved template - see step 3.
curl -X POST https://api.aionechat.com/api/v1/public/v1/messages \
-H "x-api-key: aoc_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"connection_id": "YOUR_CONNECTION_ID",
"to": "919876543210",
"type": "text",
"text": "Hello from AiOneChat API!"
}'2Fetch your connection ID
Every send needs the connection_id of the WhatsApp number the message goes out on.
curl "https://api.aionechat.com/api/v1/public/v1/connections" -H "x-api-key: aoc_live_YOUR_KEY"3Send an approved template
Templates work anytime, even outside the 24-hour window. Create and get approval on the Templates page first.
curl -X POST https://api.aionechat.com/api/v1/public/v1/messages \
-H "x-api-key: aoc_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"connection_id": "YOUR_CONNECTION_ID",
"to": "919876543210",
"type": "template",
"template": {
"name": "order_confirmation",
"language": { "code": "en_US" },
"components": [
{ "type": "body", "parameters": [
{ "type": "text", "text": "Rahul" },
{ "type": "text", "text": "#ORD-1234" }
]}
]
}
}'Response shape
Every 2xx response has this envelope. Errors return non-2xx with a message field.
{
"success": true,
"data": {
"wamid": "wamid.HBg...",
"message_id": "64abc...",
"cost": { "amount": 0.58, "currency": "INR", "category": "service" },
"wallet_balance": 99.42
}
}What to do next
- Check the API Reference tab for every endpoint + scope
- Set up a webhook to receive incoming messages
- Watch your key's Analytics page to see calls, latency, errors in real time
