Summary
In this post I'll discuss how to integrate a chat session that starts with a bot in Google Dialogflow. The user isn't able to complete the transaction with the bot and then requests a human agent for assistance. The application then connects the user with an agent on InContact's cloud platform. The bot and web interfaces I built here are crude/non-production quality. The emphasis here is on API usage and integration thereof.
This the third post of three discussing chat with InContact and Dialogflow.
InContact Chat set up: http://joeywhelan.blogspot.com/2018/03/incontact-chat.html
Dialogflow input validation: http://joeywhelan.blogspot.com/2018/04/google-dialogflow-input-validation.html
Architecture
Below is a diagram the overall architecture for the scenario discussed above.
Application Architecture
The application layer is a simple HTML page with the interface driven by a single Javascript file - chat.js. I built wrapper classes for the Dialogflow and InContact REST API's: dflow.js and incontactchat.js respectively. The chat.js code invokes API calls via those classes.
Application Flow
The diagram below depicts the steps in this example scenario.