RocketChat / Rocket.Chat.Livechat

New Livechat client written in Preact
https://rocket.chat/omnichannel/live-chat
MIT License
246 stars 228 forks source link

Client-side Amazon Lex Integration #294

Open ramezrafla opened 5 years ago

ramezrafla commented 5 years ago

We wanted to integrate Lex Chatbot to this Livechat, and when requested by user, switch to real agent (say with setDepartment). This would open huge possibilities for your corporate clients.

The problem is that we need to connect to Lex directly and handle the communication (i.e. take user message and show lex response). I don't see this in the APIs, is it feasible, or do we have to hack the code?

Thanks

renatobecker-zz commented 5 years ago

Hi @ramezrafla.

Yeah, you can handle all of the communication from your side, you can rely on both webhooks and the REST API endpoints.

Webhooks: https://rocket.chat/docs/administrator-guides/livechat/#integrations

REST API: https://rocket.chat/docs/developer-guides/rest-api/livechat/

ramezrafla commented 5 years ago

Thanks @renatobecker Seems too complex and will result in additional server calls. Right now, the way you call Lex bot is client-side (will be the same for google and MS bots)

We need a way to hook into the Livechat client. We handle the actual communication with the bot clientside and use the Livechat UI for display (until we switch to a live agent).

Is that possible?