Agent assist API

This page outlines the technical specifications of the Agent Assist API protocol. For guidance on integrating this API with your bot, see Agent assist.

An agent assist client application allows a contact center agent, to receive real time insights about the conversation they are currently having with a customer. Once the user logs in, and is in a phone conversation, they can request the assistance of a bot. The bot essentially listens in on the conversation, picking up on patterns and phrases, and sends useful data to the client that can be displayed on the user’s screen. This data can include, for example, the call transcript, boxed responses to customer questions, information pulled from a database (based on customer ID), questions to ask, pictures, audio, and more.

Different bots can be written for different types of tasks. The agent assist client application development must be done in conjunction with the bot development. The agent assist client application can request assistance from a single bot for all purposes, or request the assistance from several bots.

AudioCodes agent assist service connects to the AudioCodes VoiceAI Connect, which in turn is connected to the AudioCodes SBC, text-to-speech, speech-to-text, and the bot service. Many different speech and bot frameworks are supported. For more information see VoiceAI Connect documentation.

The agent assist API is based on socket.io. Socket.io has a JavaScript client as well as implementations in several other languages. For more information about how to develop a socket.io client, click here.

This feature is applicable only to VoiceAI Connect Enterprise (Version 3.4 and later).

API overview

Authentication

The agent starts by opening a socket.io connection with the service.

Authentication with the service is performed using a token and will be passed at the socket.io connection

Example:

const socket = io('https://vaicCenterIp', { 
path: '/agentAssist/socket.io',
query: {
	token: 'thisisthetoken'
}
});
 

The token is configured in the agentAssist section in VoiceAI Connect configuration.

Sending and receiving messages

Once a socket is open, the client can emit events, and listen for events from the server.

For each outgoing message, the client emits an event with the message name, and a single parameter which is a JSON object.

socket.emit('message name', JSON object);

Example:

socket.emit('stopBotAssist', {
    callKey: activeCallKey,
    botName: activeBotName
});

The client can listen for incoming events, execute a callback, where the event is the message name, and a single parameter which is a JSON object.

socket.on('message name', callback);

Example:

socket.on('callEnded', obj => {
	const {callKey, src} = obj;
	// handle the message
});

API messages

init

Once the WebSocket is established, the agent sends an init message over the WebSocket.

Parameter:

Example:

{
   "agentId":"+97239761234"
}

initResponse

On init request, the service will return this message to the agent.

Parameters:

activeCalls: This field is present if callsNotification is set to "true" in the init request. A list of the currently active calls, where each call contains:

Example:

{
   "activeCalls":[
    {
         "callKey":"14e334973660494882111k54406rmwp",
         "activeBotAssists": [{
         "botName": ""
      }]
    }
  ]
}

getBotAssist

The client application will send this message to start an agent assist session.

Parameters:

Example:

{
   "callKey":"14e334973660494882111k54406rmwp",
   "metadataToBot":{
      "agentName":"John Smith"
   },
   "botName":"technicalSupportAssist"
}

stopBotAssist

The agent will send this message once the user clicks the end agent assist button.

Parameters:

Example:

{
   "callKey":"14e334973660494882111k54406rmwp",
   "botName":"technicalSupportAssist"
}

botAssistSessionStarted

VoiceAI Connect sends the client this message indicating that the agent assist session has been successfully started.

Parameters:

Example:

{
   "callKey":"14e334973660494882111k54406rmwp",
   "botName":"technicalSupportAssist"
}

botAssistSessionFailed

VoiceAI Connect shall send the client this message if it has failed to set up the agent assist session.

Parameters:

Example:

{
   "callKey":"14e334973660494882111k54406rmwp",
   "botName":"technicalSupportAssist"
   "reason":"SipRec request timed out"
}

botAssistSessionEnded

VoiceAI Connect sends this client this message indicating that the agent assist session has ended.

Parameters:

Example:

{
   "callKey":"14e334973660494882111k54406rmwp",
   "botName":"technicalSupportAssist"
}

metadata

The bot can send Metadata (containing a JSON object) to the session manager. VoiceAI Connect forwards the metadata received from the bot to the client in this message.

If the bot wishes to send binary data (e.g., image files) it can encode the data, and send it encapsulated in the JSON object.

Parameters:

Example:

{
   "callKey":"14e334973660494882111k54406rmwp",
   "botName":"technicalSupportAssist"
   "data":{
      "participant":"participant-1",
      "text":"I would like a pizza"
   }
}

callStarted

If callsNotification is set to true in the init request, this message is sent to the client when a call starts.

Parameters:

Example:

{
   "callKey":"14e334973660494882111k54406rmwp",
   "src":"+97239764444"
}

callEnded

If callsNotification is set to true in the init request, this message is sent to the client wrequest an agent

Parameters:

Example:

{
   "callKey":"14e334973660494882111k54406rmwp",
   "src":"+97239764444"
}