This guide explains how to integrate your chatbot with different communication channels to make it accessible to your users.
iky_base_url
)chat_context
)<html>
<head>...</head>
<body>
...
</body>
<script type="text/javascript">
!function(win,doc){"use strict";var script_loader=()=>{try
{var head=doc.head||doc.getElementsByTagName("head")[0],script=doc.createElement("script");script.setAttribute("type","text/javascript"),script.setAttribute("src","https://alfredfrancis.in/ai-chatbot-framework/app/static/widget/script.js"),head.appendChild(script)}
catch(e){}};win.chat_context={"username":"John"},win.iky_base_url="http://localhost:8080/admin/",script_loader()}(window,document);
</script>
</html>
Authorization: Bearer YOUR_API_KEY
POST /api/bots/channels/rest/webbook
{
"thread_id":"123456",
"text": "hello world",
"context": {
"Name": "Alfred"
// additional context data
}
}
[{"text":"Hello Alfred 👋 "},{"text":" What can i do for you ?"}]
Sample cURL request:
curl 'http://<your-external-ip>:8080/api/bots/channels/rest/webbook' \
-H 'Content-Type: application/json' \
--data-raw '{"thread_id":"test-user","text":"/init_conversation","context":{"username":"Admin"}}'