Integration Guide
Connect your CRM, WooCommerce, or custom app to Heel Tech AI Bot via API.
Authentication
All API requests require these headers:
X-API-Key: your-api-key
X-API-Salt: your-api-salt
Content-Type: application/json
Get API Key and Salt from Heel Tech AI Bot Dashboard → CRM or WooCommerce Integration
CRM Integration
1. Webhook (receive events)
POST to:
Configure your CRM to send webhooks when leads/contacts are created.
{
"event": "lead_created",
"phone": "919876543210",
"data": {
"name": "John Doe",
"email": "john@example.com",
"phone": "919876543210",
"source": "Website"
}
}
Custom: {"message": "Text", "phone": "919876543210"} — Add image, caption, buttons for rich messages.
2. Send Message (direct)
POST to:
{
"phone": "919876543210",
"message": "Hello! Your inquiry has been received."
}
3. Image + Caption
{
"phone": "919876543210",
"image": "https://example.com/image.jpg",
"caption": "Check out this product!"
}
Or base64: {"image": {"data": "base64...", "mimetype": "image/jpeg"}, "caption": "Text"}
4. Buttons (max 3)
{
"phone": "919876543210",
"message": "Choose an option:",
"buttons": [
{"id": "opt1", "body": "Option 1"},
{"id": "opt2", "body": "Option 2"},
{"body": "Option 3"}
],
"title": "Select",
"footer": "Powered by Heel Tech AI Bot"
}
Image & Buttons Payload
| Field | Description |
| message | Text message or caption |
| image | Image URL or {"data":"base64","mimetype":"image/jpeg"} |
| caption | Text with image (use message if no caption) |
| buttons | Array of {"id":"x","body":"Label"} (max 3) |
| title | Optional button title |
| footer | Optional button footer |
Event Types (CRM Webhook)
| Event | Description |
| lead_created | New lead – auto-formats name, email, phone, source |
| contact_added | New contact – auto-formats name, email, company |
| deal_won | Deal won – auto-formats title, value, contact |
| (custom) | message + phone. Add image, buttons for rich content. |
cURL Examples
Text message:
curl -X POST "/api/crm/send" \
-H "X-API-Key: your-api-key" -H "X-API-Salt: your-api-salt" \
-H "Content-Type: application/json" \
-d '{"phone":"919876543210","message":"Hello!"}'
Image + caption:
curl -X POST "/api/crm/send" \
-H "X-API-Key: your-api-key" -H "X-API-Salt: your-api-salt" \
-H "Content-Type: application/json" \
-d '{"phone":"919876543210","image":"https://example.com/photo.jpg","caption":"Check this out!"}'
Buttons:
curl -X POST "/api/crm/send" \
-H "X-API-Key: your-api-key" -H "X-API-Salt: your-api-salt" \
-H "Content-Type: application/json" \
-d '{"phone":"919876543210","message":"Choose:","buttons":[{"id":"1","body":"Yes"},{"id":"2","body":"No"}]}'
Webhook (lead):
curl -X POST "/api/crm/webhook" \
-H "X-API-Key: your-api-key" -H "X-API-Salt: your-api-salt" \
-H "Content-Type: application/json" \
-d '{"event":"lead_created","phone":"919876543210","data":{"name":"John","email":"john@example.com"}}'
WooCommerce
POST to:
Events: order_created, order_status, order_completed
Supports image, caption, buttons in payload (e.g. product image with order).
Use the Heel Tech AI Bot WordPress plugin for automatic integration.
PHP Examples
Text:
$data = ['phone' => '919876543210', 'message' => 'Hello!'];
// Image: $data = ['phone' => '...', 'image' => 'https://...', 'caption' => '...'];
// Buttons: $data = ['phone' => '...', 'message' => 'Choose', 'buttons' => [['id'=>'1','body'=>'Yes'],['id'=>'2','body'=>'No']]];
$ch = curl_init('/api/crm/send');
curl_setopt_array($ch, [
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => json_encode($data),
CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'X-API-Key: your-key', 'X-API-Salt: your-salt'],
CURLOPT_RETURNTRANSFER => true
]);
$response = curl_exec($ch);
curl_close($ch);
CRM Setup (Generic)
- Add a CRM connection in Heel Tech AI Bot Dashboard → CRM Integration (use Generate for API Key/Salt)
- Copy API Key, Salt, Webhook URL, and Send API URL
- In your CRM: Webhooks / Integrations / Automation
- Add webhook: URL = Webhook or Send URL, Method = POST
- Headers:
X-API-Key, X-API-Salt, Content-Type: application/json
- Payload:
phone, message — or image+caption, or buttons