Implement a Custom Virtual Agent Integration

This page describes the general process you must follow when implementing a custom virtual agent integration. Every environment and every custom integration is different. Your situation may require additional tasks not described here. It's your responsibility to understand what your integration requires, and if additional tasks are needed, where they fit into the process described on this page.

Complete each of these tasks in the order given.

Set Up the Virtual Agent and Authorization Server

Set up the virtual agent in the provider's environment. Complete thorough testing to ensure that it works as you expect it to.

If your integration uses dynamic authentication, set up the authorization server.

Set Up the Proxy Tunnel Endpoint

To complete this task, you must put the proxy tunnel code in place and run the commands that initiate the code and expose the endpoints. The exact steps and commands required will be different for every environment.

Set Up Required Studio Scripts

Required permissions: ACD > Studio > Studio Scripts > Create/Edit, Import/Export, Debug, Lock Override; ACD > Studio > Record Prompts > On; ACD > Studio > File Browser > Edit, Create

Ensure that all required Studio scripts are in your production environment. You may need to:

  • Export the scripts from one environment and import them into another. You may want to create a folder specifically for scripts related to your custom virtual agent integration.
  • Save the scripts with new names. If you use naming conventions for version management, you need to change the scripts' names to move them from development to production. Studio doesn't support changing script names. To rename them, you must use the File > Save As option.

Ensure that the virtual agent actions are correctly set up. This means that: 

  • The Custom Exchange Endpoint app is created in Virtual Agent Hub.
  • Every virtual agent action in your scripts has the Custom Exchange Endpoint app assigned to it.
  • The connection between the script and the virtual agent works as expected after you move the script into production. Do some testing from the Custom Exchange Endpoint app in Virtual Agent Hub to verify the connection.

Configure the Connection Between CXone and Your Virtual Agent

Required permissions: ACD > Studio > Studio Scripts > Create/Edit; Integrations > Launch

The connection between your virtual agent and CXone is the virtual agent action in your Studio scripts. The action must be configured with the details needed so the two systems can communicate. You do this by creating a configuration app in Virtual Agent Hub, then assigning it to every instance of the virtual agent actions in your script.

You only need to complete this task once, even if you have more than one virtual agent action in your script.

The virtual agent actions are VoiceBot Exchange and TextBot Exchange.

The Configuration Page for the Custom Exchange Endpoint app is different depending on which integration version you're using. Follow the steps in the section below for your version. The differences between the versions are: 

  • 1.0.0: Supports a single authorization header. The header is sent with the ExternalIntegrationBotExchangeRequest request.
  • 2.0.0: Supports multiple authorization headers. The headers are sent with the ExternalIntegrationBotExchangeRequest request as key-value pairs.
  • 3.0.0: Supports multiple authorization headers and StandardBot. The headers are sent with the ExternalIntegrationBotExchangeRequest request as key-value pairs.
  • Integration versions 1.0.0 and 2.0.0 will be deprecated in a future release. Version 3.0.0 is the preferred version to use with custom virtual agent integrations. If you currently use version 1.0.0 or 2.0.0, plan to upgrade to 3.0.0. Version 3.0.0 is nearly identical to version 2.0.0. The primary difference is that 3.0.0 adds support for StandardBot.

Configure Integration Version 1.0.0

  1. In CXone, click the app selector and select Other > Automation & AI and then click Virtual Agent Hub. You can also double-click the virtual agent action in your Studio script to launch Virtual Agent Hub.
  2. Click Add Bot.
  3. Enter a Virtual Agent (Bot) Name and select Custom Exchange Endpoint as the Bot Provider.
  4. Click Next.
  5. Select Integration Version1.0.0.

  6. Enter the Webhook URL for your virtual agent. This is the endpoint the script sends all requests to.
  7. If you're using authorization with your custom virtual agent integration, enter the Authorization Header from your virtual agent service. The header is sent with the ExternalIntegrationBotExchangeRequest request.
  8. To include parameters with each request sent to the virtual agent service, click Add Endpoint Parameters. Enter the parameter's Name and Value. Repeat this step to add more parameters.

  9. To change the default Timeout, enter the number of milliseconds the script waits for the virtual agent service to respond before timing out. The default is 10000.

  10. Click Next on the Configuration page.
  11. Complete the Voice and Transcript pages in the Add Bot wizard.
  12. Test your integration.
  13. Assign the Custom Exchange Endpointsconfiguration app to the virtual agent actions in your script.

Configure Integration Version 2.0.0 and 3.0.0

  1. In CXone, click the app selector and select Other > Automation & AI and then click Virtual Agent Hub. You can also double-click the virtual agent action in your Studio script to launch Virtual Agent Hub.
  2. Click Add Bot.
  3. Enter a Virtual Agent (Bot) Name and select Custom Exchange Endpoint as the Bot Provider.
  4. Click Next.
  5. Select Integration Version 2.0.0 or 3.0.0.

  6. Enter the Webhook URL for your virtual agent. This is the endpoint the script sends all requests to.
  7. To send headers with the webhook URL, click Add Custom Headers. This includes authorization headers. Enter the header's Name and Value. Repeat this step to add more headers.

    If you're using OAuth dynamic authentication, skip this step.

  8. To include parameters with each request sent to the virtual agent service, click Add Endpoint Parameters. Enter the parameter's Name and Value. Repeat this step to add more parameters.

  9. To change the default Timeout, enter the number of milliseconds the script waits for the virtual agent service to respond before timing out. The default is 10000.

  10. To use mTLS authentication with your custom virtual agent integration, click Add Webhook Client Certificates and configure the details of your certificate.
  11. To configure dynamic authentication with your custom integration, click O Auth Required to toggle it to On and configure the required fields.
  12. Click Next on the Configuration page.
  13. Complete the Voice and Transcript pages in the Add Bot wizard.
  14. Test your integration.
  15. Assign the Custom Exchange Endpointsconfiguration app to the virtual agent actions in your script.

Configure mTLS Authentication with Client Certificates

You can add client certificates and keys to your Custom Exchange Endpoints app to use mTLS authentication with your custom integration.

Before you begin, you must have a certificate and private key in PEM format.

  1. In Virtual Agent Hub, select the Custom Exchange Endpoints app you want to modify.

  2. Click Add Webhook Client Certificates.

  3. Enter an optional Certificate Name. This can be any word or phrase that identifies the certificate.

  4. Copy the encoded plain text from the certificate's PEM file and paste it into the Certificate field.

  5. Copy the encoded plain text of the private key from the PEM file and paste it into the Private Key field.

  6. Enter the Certificate Password.

  7. If you need to add more client certificates, click Add Client Certificates and repeat steps 2-5.

  8. Save your changes.

Configure Dynamic Authentication with OAuth for Version 2.0.0 or 3.0.0

If you're using dynamic authentication with your custom integration, you can have the Custom Exchange Endpoint app to manage your tokens. If you enable this option, it overrides the custom header value retrieved by the authorization server.

  1. In Virtual Agent Hub, select the Custom Exchange Endpoints app you want to modify.
  2. Click O Auth Required to toggle it to On.
  3. Enter the URL of your authorization server in the OAuth URL field.  
  4. Select JSON or Form URL Encode under Request Content Type. This is the body type of the OAuth requests.
  5. Click Add OAuth Request and enter the key-value pairs that form the authentication request body. This includes thing such as API secrets and client credentials. Enter the key Name and Value. Repeat this step to add more request parameters.
  6. Click Add OAuth Headers and enter the key-value pairs for any headers your authorization server requires requests to include. Enter the key Name and Value. Repeat this step to add more header parameters.
  7. To customize the authorization headers sent with requests to your virtual agent provider, click Custom Header Auth to toggle it On and then:

    1. Enter a new Authorization Header Name to change the name of the key in the key-value pair for the authorization header. The default is Authorization.
    2. Enter a new Authorization Header Value Prefix to change the prefix sent with the header value. The default is Bearer.
  8. To customize how long the authorization token lasts before expiring, enter a new Auth Expiry Time. The default is 0.

  9. Select an option from the Select OAuth Certificate drop-down to indicate if you want to use a certificate with your OAuth authorization server. If you want to use a certificate, you can choose to Use Webhook Client Certificate or Add New Client Certificate For Auth Server.

  10. Click Save.

Configure Voice and Transcript Options

The Voice page allows you to configure the Custom Exchange Endpoints app to be for a voice virtual agent or a text virtual agent. For text virtual agents there are no additional settings to configure. For voice virtual agents, you can select: 

  • The kind of voice integration you're doing.
  • The text-to-speech (TTS) service you want to use.
  • The transcription (speech-to-text/STT) service you want to use.

The Transcript page in the Custom Exchange Endpoints wizard allows you to select whether you want your integration to capture transcripts of the virtual agent's conversations with contacts.

  1. In Virtual Agent Hub, add the Custom Exchange Endpoint app and complete the Configuration page for version 1.0.0 or version 2.0.0/3.0.0.
  2. Click Next on the Configuration page.
  3. If you're setting up a text virtual agent integration, select Text Only on the Voice page under Voice Integration Options and then click Next. Skip to step 10 in this section.

  4. If you're setting up a voice virtual agent, select the option for the kind of voice integration you're setting up from the list on the Voice page under Voice Integration Options.

  5. If you're setting up an integration with a SIP backchannel or custom telephony connection, click Next and skip to step 10 in this section.
  6. Under Text to Speech Options, select Use CXone Cloud TTS Hub. This is the only option for custom virtual agent integrations, so you can ignore the text on the page about clearing the checkbox and selecting the option to use the virtual agent provider's TTS service.

  7. Select the TTS Vendor you want to use with your custom integration. The options are the vendors that CXone Cloud TTS Hub currently supports.
  8. Under Transcription Options, select speech-to-text service you want to use.

  9. Click Next.
  10. On the Transcript page, select the option for whether you want to capture the virtual agent's conversation transcripts.

  11. Click Next.
  12. Test your virtual agent integration if you want, or click Add to add the Custom Exchange Endpoints configuration app to Virtual Agent Hub.

Test Your Custom Virtual Agent Integration

Required permissions: ACDStudioStudio Scripts > Create/Edit; Integrations > Launch

This step tests the connection between CXone and the virtual agent. It ensures that the virtual agent functions the way you expect it to when communicating with CXone.

You can test many aspects of your virtual agent to make sure everything works as intended. You can run tests from the virtual agent app's properties page in Virtual Agent Hub. When testing, you can: 

  • Verify that the virtual agent app is correctly configured to communicate with the virtual agent provider.
  • Add custom payload JSON to test the virtual agent's handling of custom payload data.
  • Trigger a welcome intent event to test how the virtual agent begins a conversation.
  • Trigger a custom intent event to test any custom events you've created for your virtual agent.
  • Trigger a timeout event to test how the virtual agent responds when the contact times out.
  • Test how the virtual agent handles DTMFClosed Signaling tones that are generated when a user presses or taps a key on their telephone keypad. input.

The following image is an example of the properties page for a virtual agent app in Virtual Agent Hub. It shows the Configuration and Voice tabs and the Test pane.

  1. In CXone, click the app selector and select Other > Automation & AI and then click Virtual Agent Hub. You can also double-click the virtual agent action in your Studio script to launch Virtual Agent Hub.
  2. Click to select the configuration app for the virtual agent you want to test from the list on the left.
  3. In the Test pane, enter a test message in the Type a message field and press Enter to send it. You can also click Microphone An icon shaped like a microphone. and speak into your computer's microphone.

  4. Click Start with welcome intent to start a test conversation from the beginning. The virtual agent responds with its default welcome message. You can enter test messages.
  5. Click More Options An icon with three dots stacked vertically. to test other aspects of your virtual agent.

  6. Click Reset to start your test again.
  7. If you need to make changes based on the results of your testing, you can: 

    • Modify the Studio scripts for the virtual agent.
    • Modify the configuration settings in the virtual agent's app in Virtual Agent Hub.
    • Modify the virtual agent's configuration settings in the provider's console. Click the large square button on the app properties page in Virtual Agent Hub. The example at the beginning of this section shows the Google Dialogflow CX app with the provider button. It has the An icon that has a square with an arrow overlaid on top of it. The arrow points from the center of the square to the top right corner of the square. icon on it to indicate that the link opens an external site.
  8. Test the virtual agent thoroughly after each change to your scripts or any configuration settings.
  9. When you're finished testing, click Close.

Assign the Virtual Agent to a Studio Action

Required permissions: ACDStudioStudio Scripts > Create/Edit

When the virtual agentClosed The meaning or purpose behind what a contact says/types; what the contact wants to communicate or accomplish app is set up and configured in Virtual Agent Hub, you need to assign it to the virtual agent action in your script. This connects the action and the script to your virtual agent provider.

  1. In Studio, open the script you want to modify.
  2. Locate the virtual agent action in the script and double-click it to open Virtual Agent Hub.

  3. In the left column, locate the virtual agent that you want to assign to the action and click the checkmark An icon of a circle with a checkmark inside. next to it.
  4. Click Close.

Complete Channel-Specific Requirements

Required permissions: ACD> Contact Settings > Campaigns > Edit, Create; ACD> Contact Settings > Points of Contact  > Edit, Create; ACD> Contact Settings > Skills > Create, Edit, User Assign; ACD> Contact Settings > Chat Profiles > Create, Edit; ACD> Digital Engagement > Channels Settings

Set up the channelClosed A way for contacts to interact with agents or bots. A channel can be voice, email, chat, social media, and so on. that contacts will use to initiate interactions with your virtual agent.

For CXone chat or voice channels: 

For Digital Experience channels:

If you use a naming convention as version control with your Studio scripts, be sure to save your script with its production name before assigning it to the point of contact.

Ensure that you have completed all requirements for your channel, including things such as:

  • Creating a chat profile for ACD chat.
  • Setting up the chat or messaging option for digital channels where conversations begin on other websites, such as Google Business Messages or Twitter direct messaging.
  • Adding the chat to your website or mobile app (CXone chat and digital chat).

Test The Script from the Point of Contact

Required permissions: ACD > Contact Settings > Points of Contact  > View, Edit

When the point of contactClosed The entry point that an inbound contact uses to initiate an interaction, such as a phone number or email address. is set up, you need to test your script starting from the point of contact. You can use script tracing to check on the effectiveness of your script and identify any issues that arise.

The testing you did earlier in the implementation process tested the connection between the virtual agent and CXone. The testing in this step verifies the entire integration, from the contact through CXone to the virtual agent.

  1. In Studio, open the script that the point of contact calls.
  2. Click Debug > Capture ScriptNext Instance Only.
  3. Initiate an interaction. How you initiate it will vary by channelClosed A way for contacts to interact with agents or bots. A channel can be voice, email, chat, social media, and so on.. For example:

    In Studio, the Trace Output window opens. It displays the progress of the script as you type responses and the virtual agent responds.

  4. Click an action in the main pane in the Trace Output window.

    • The Variables tab shows all of the variables that exist in the script when the selected action has completed. It also shows the value that each variable holds at that point in the script.
    • The Properties tab shows you the properties for the selected action. You can use this to verify the action's current configuration.
  5. Return to the script and make changes, if necessary.
  6. Select an action and press F1 on your keyboard to access online help for that action. The online help page for each action describes the properties and other information about using the action in a script.
  7. If you want to start over, click End Chat, refresh the browser window, and repeat this process, starting with step 2.