Developer Technical Docs
Integrate AI business assistants into websites and WhatsApp, and use internal AI APIs for customer engagement, service workflows, and automation.
Section Navigation
Use your chatbot integration key to load the widget and send visitor messages from any website.
Quickstart
- 1Create a chatbot in the dashboard and keep it active.
- 2Open Integration and copy your embed snippet.
- 3Add the snippet before </body> on your website pages.
- 4Verify widget config and chat responses are loading.
Examples
Embed Snippet
<script
src="https://botstudio.variablesoft.com/embed.js"
data-bot-id="cb_your_integration_key"
data-theme="blue"
data-position="bottom-right"
data-auto-open="false">
</script>Send Chat Message
curl -X POST "https://botstudio.variablesoft.com/api/chat/cb_your_integration_key" \
-H "Content-Type: application/json" \
-d '{
"event": "message",
"sessionId": "web_session_001",
"message": "Can you help with pricing?"
}'Troubleshooting
- If the widget does not load, confirm the integration key belongs to an active chatbot.
- If requests fail from external sites, confirm allowed origin configuration for public endpoints.
- If no answer is returned, check the chatbot auto-reply setting and linked knowledge base in dashboard.
Receive inbound WhatsApp text messages, route by phone number id, and reply using the chatbot AI flow.
Quickstart
- 1Enable WhatsApp settings on the chatbot with Access Token, Phone Number ID, and Verify Token.
- 2Set Meta webhook callback URL to /api/whatsapp/webhook.
- 3Verify webhook using WHATSAPP_VERIFY_TOKEN (or stored bot verify token fallback).
- 4Send a WhatsApp text message and confirm AI reply in the same thread.
Endpoints
/api/whatsapp/webhookHandles webhook verification challenge.
/api/whatsapp/webhookProcesses inbound WhatsApp webhook events.
Text messages are supported in v1. Status and non-text events are acknowledged and ignored.
/api/whatsapp/webhook/:botIdCompatibility verification alias.
Deprecated for new integrations. Use /api/whatsapp/webhook.
Examples
Webhook Verification Request
curl "https://botstudio.variablesoft.com/api/whatsapp/webhook?hub.mode=subscribe&hub.verify_token=YOUR_VERIFY_TOKEN&hub.challenge=123456"Inbound Webhook Shape (text event)
{
"entry": [
{
"changes": [
{
"field": "messages",
"value": {
"metadata": { "phone_number_id": "1234567890" },
"contacts": [{ "wa_id": "919999999999", "profile": { "name": "Rahul" } }],
"messages": [{ "id": "wamid.abc", "from": "919999999999", "type": "text", "text": { "body": "Hello" } }]
}
}
]
}
]
}Troubleshooting
- If webhook verification fails, check WHATSAPP_VERIFY_TOKEN and the token entered in Meta app settings.
- If no chatbot is found, ensure chatbot has whatsappEnabled=true and matching whatsappPhoneNumberId.
- If replies are missing, verify whatsappAccessToken validity and phone number id permissions.
Call the VSBotStudio AI gateway for internal tools and service-to-service use cases.
Quickstart
- 1Set your VSBotStudio base URL in your environment.
- 2Create or obtain a VSBotStudio company API key with external AI query access.
- 3Send query, external_conversation_id, and optional kb_id to /api/external/ai/query.
- 4Use response text and usage summary in your internal workflow.
Endpoints
/api/external/ai/queryVSBotStudio resolves the configured task routes and forwards a validated routing snapshot to Python AI.
Examples
VSBotStudio AI Query Request
curl -X POST "${VSBOTSTUDIO_URL}/api/external/ai/query" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_COMPANY_API_KEY" \
-d '{
"query": "Summarize our refund policy",
"external_conversation_id": "internal-example-001",
"kb_id": 1
}'Typical /ai/query Response
{
"response": "Your refund policy summary...",
"insufficient_context": false,
"usageSummary": {
"total_input_tokens": 215,
"total_output_tokens": 142,
"total_tokens": 357
}
}Troubleshooting
- If 401/403 is returned, validate x-api-key and service authorization rules.
- If usageSummary is missing, inspect upstream AI response contract.
- Use internal network controls because this endpoint is intended for trusted systems.