Integración entre Dialogflow y Kommunicate

Tabla de contenidos

¿Que és Kommunicate?

Kommunicate es una herramienta que proporciona una interfaz gráfica de un chatbot, y puede ser integrada con Dialogflow (https://www.kommunicate.io/).

 

¿Cómo integrar Kommunicate con Dialogflow?

Teniendo ya creado un chat bot de Dialogflow, hay que dirigirse a Kommunicate y pulsar a Manage Bots (sección Bot Integration) para posteriormente hacer click en Create new Bot.

 

Se deberá seleccionar la opción de Dialogflow y seguir los pasos:

 

Una vez creado, se podrá embeber en la página web de la empresa con el chatbot de dos maneras:

  • Insertando iframe: se deberá insertar el siguiente código: 
    <iframe
    style="border: none;"
    height="600px"
    width="400px"
    src="https://widget.kommunicate.io/chat?appId=<YOUR_APP_ID>&botIds=<YOUR_BOT_ID>&assignee=<YOUR_BOT_ID>"
    allow="microphone; geolocation;">
    </iframe>

    Y se verá de la siguiente manera:

  • Insertando script: se deberá insertar el siguiente código: 
    <script type="text/javascript">
    (function(d, m){
    const defaultSettings = {
    "defaultBotIds": [<YOUR_BOT_ID>],
    "defaultAssignee": "<YOUR_BOT_ID>",
    "skipRouting": true
    };
    const kommunicateSettings =
    {
    "appId": "<YOUR_APP_ID>",
    "popupWidget": true,
    "automaticChatOpenOnNavigation": true,
    "onInit": function () {
    window.kommunicate.updateSettings(defaultSettings);
    }
    };
    const s = document.createElement("script");
    s.type = "text/javascript"; s.async = true;
    s.src = "https://widget.kommunicate.io/v2/kommunicate.app";
    const h = document.getElementsByTagName("head")[0];
    h.appendChild(s);
    window.kommunicate = m; m._globals = kommunicateSettings;
    })(document, window.kommunicate || {});
    </script>

         Y se verá de la siguiente manera abierto:

Y cerrado: