openchatbot-client is a webchat box compatible with Open ChatBot format created by Alliance For Open ChatBot.
let apiEndPoint = "https://openchatbot.io/api/v1.0/ask"
let webClientURL = 'https:\/\/metaboto.com/openchatbot-webclient\/'
Because of the use of ajax for getting content from API Endpoint, Open ChatBot json format result should be embedded within a function. So the recommended architecture is to have a proxy website between your ChatBox and the formal open Chatbot API so that content returned to the ChatBox is embedded within a function.
The ChatBox expected embedding function name is parseocbAnswer
So ChatBox would call your website proxy API with a callback parameter giving the function name like so:
curl "https://metaboto.com/api/metaboto/rest/v2.0/ask?userId=2371aeb8-58d2-41bc-8382-1a205b0cbd2d&query=%40doungdoung%20hello&callback=parseocbAnswer"
And response would look’s like:
parseocbAnswer({"meta": {"authors": ["Olivier HO-A-CHUCK"], "botName": "OpenChatBot MetaBoto", "copyright": "Copyright 2020 metaboto.com", "version": "3.9"}, "response": {"query": "@doungdoung hello", "text": "I'm DoungDoung bot. Your query is\"hello\".", "timestamp": 1604170101.301502, "userId": "2371aeb8-58d2-41bc-8382-1a205b0cbd2d"}, "status": {"code": 200, "message": "success"}})
You can test this box on metaboto.com.
Call any ChatBot compatible Open ChatBot that have declared their API enpoint using DomainBots standard.
For instance, test "@doungdoung hello", or "@openchatbot what time is it". Both sites have referenced their bots on their domain name.