Probar a canle de mensaxería personalizada

Dynamics 365 Contact Center permíteche implementar un conector para integrar canles de mensaxería personalizadas. O código completo exemplo ilustra como podes crear o teu propio conector que se integre con Dynamics 365 Contact Center usando o Direct Line Bot.

Exemplo de código para probar a canle de mensaxería personalizada

Podes usar o seguinte código de exemplo para probar o canal de mensaxería personalizado que queres levar ao Dynamics 365 Contact Center. Podes modificar o código de mostra para adaptarte ás necesidades da túa organización.

<!DOCTYPE html>
<html lang="en-US">
<head>
    <title>Web Chat: Full-featured bundle</title>

    <script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>

    <style>
    html, body { height: 100% }
    body {
      margin: 0;
      background-color: paleturquoise;
    }
    #webchat {
      height: 100%;
      width: 100%;
    }
  </style>
</head>
<body>
       <div id="webchat" role="main"></div>
    <script>
    (async function () {
        const res = await fetch('https://directline.botframework.com/v3/directline/conversations', 
{ method: 'POST', headers: { Authorization: 'Bearer ***************Insert Direct Line Secret here *******************' }});

      const { token } = await res.json();

      (async function () {
	window.WebChat.renderWebChat({
      directLine: window.WebChat.createDirectLine({ token }),
      styleOptions: {
        rootHeight: '100%',
        rootWidth: '50%',
		bubbleMaxWidth: 1200,               
        botAvatarInitials: 'C',                
        userAvatarInitials: 'A',  
      }
    }, document.getElementById('webchat'));
    })()
    })().catch(err => console.error(err));
   </script>
</body>
</html>

Pasos seguintes

Conceptos clave en Direct Line API 3.0

Trae a túa propia canle personalizada usando Direct Line
Configurar a canle de mensaxería personalizada