Skip to main content
This document provides an overview of the setup and configuration process of the Agent AI widget with NICE CX Telephony using the Salesforce NICE CX CTI package. Use Case: Show voice transcripts and provide next-best actions from a configured AI Agent, on the Agent AI widget, to agents when they receive a phone call from a customer. When a customer calls a NICE CX phone number, the call is received on the Salesforce NICE CTI interface. Based on the customer’s phone number, the CTI rule matches the corresponding Salesforce object (such as Account/Contact/Case) and displays it to the agents. The incoming voice stream is shared with Voice Gateway, which in turn generates transcripts of the voice stream and displays them in the Agent AI widget embedded in the matched Salesforce object.

Prerequisites

  • The NICE CX Salesforce package installed in your Salesforce org.
  • NICE CX account set up and can receive calls on the Salesforce Service Console softphone.
  • NICE CX Studio installed on your device.
  • Agent Assist Hub enabled for your NICE CX account.
  • AgentAssist for Salesforce installed on your Salesforce account. (Salesforce AppExchange > Search for “Agent AI By Kore.ai, Inc.”)
  • Have the AI Agent credentials saved separately. You need the Widget URL, Bot ID, Client ID, Client Secret, Account ID, and SIP URI. Read Voice Gateway and Chat for a walkthrough.
  • Ensure that Voice Interaction Streams are enabled via NICE.

Shared Responsibilities

Definitions

Region-Specific URLs

Architecture Diagrams

Chat

chat-architecture

Voice

voice-architecture

Set up Salesforce-NICE CTI package

Follow this article to install and configure the NICE CTI package on your Salesforce account. Topics included in the above article:
  • Install Salesforce Agent
  • Install the Salesforce Agent Package
  • Assign Users to Your License
  • Enable Salesforce Agent in Lightning Experience
  • Configure Permission Sets For a Single User
  • Configure Permission Sets For Multiple Users
  • Configure the NICE CXone Call Center
  • Assign Users to the NICE CXone Call Center
  • Configure Softphone Layout
  • Assign Profiles to the Softphone Layout
  • Enable Click2Jack

Set up NICE AgentAssist Hub to stream voice to Agent AI

The studio script uses this app.
  1. Sign in to your NICE account with the username and password provided by NICE customer support.
  2. Click the applications launcher button. A menu opens from the left side of the page. applications_launcher_button
  3. Click OTHERS > Automation & AI. automation_ai
  4. Click Agent Assist Hub > Add Agent Assist App. add_agentassist_app
  5. Enter the name of the Agent Assist App in the AGENT ASSIST APP NAME field.
  6. Select Custom Agent Assist Endpoints.
  7. Click Next. next
  8. Add the following settings with config parameters provided by the Support team:
    • Agent UI Option: Available by default
    • App URL: {Agent AI URL}/integrations/nice/iframe/?params={scriptparams}
    • App Title: Kore Agent AI (change as needed)
    • Participants: Both
    • Text Relay Endpoint: (only for chat) {Agent AI URL}/integrations/nice/relay/toKore configurations
    • Audio Relay Endpoint: {Voice Gateway(VG)}/audiosocket/nice?sipuri<Bot SIP URI>&token=<Token>&botId=<Bot ID>&accountId=<Account ID>&agentassist=true
      • Bot SIP URI: Channels > Voice section of the Agent AI configuration portal. channels_voice
      • Bot ID and Account ID: Channels > Chat section of the Agent AI configuration portal. channels-chat
      • Token: Create a JSON Web Token on jwt.io with the following details.
        • Payload: {"appId": <Bot Client ID>}
        • Header: {"alg": "HS256","typ": "JWT"}
        • Secret: Your Kore.ai Client Secret.
    • Scroll down and add the following Configuration Parameters. (Only for Chat). configuration-parameters
  9. Click Create

Agent AI package setup and configuration

  • Install Agent AI on your Salesforce account.

Set up the AgentAssist feature

  1. Click the app launcher. app-launcher
  2. Type kore in the search box and select Kore AgentAssist Feature Configuration from the displayed list. kore-agentassist-feature-configuration
  3. Click New from the top-right corner of the page. new
  4. Type Test Configuration in the Configuration Name field. test-configuration
  5. Select NICE inContact in the CTI Provider list. nice-incontact
  6. Select Active, and click Save. active-save

Set up the AgentAssist Configuration

  1. Click the app launcher.
  2. Type config in the search box, and select Kore AgentAssist Configuration from the displayed list. kore-agentassist-configuration
  3. Click New from the top-right corner of the page.
  4. Enter the required details. You can fetch the AgentAssist URL, Bot ID, Client ID, and Client Secret details from the Agent AI configuration portal. configuration-portal
    • Select a language in the Language dropdown list. The selected language corresponds to the language configured in the AI Agent. configuration-details
  5. Select Active and click Save.

Configure NICE CTI Data in Salesforce

  1. Click the app launcher in Salesforce, and then go to Salesforce Agent Settings.
  2. Sign in to your NICE CX account.
  3. Ensure the Store Salesforce Agent Script Variables setting is enabled in the Data Storage section.
  4. In the dropdown list, select a Salesforce object against which the Agent AI widget needs to be configured in its page layout. salesforce-object-selection

Configure Page layout to embed the Agent AI Widget to Salesforce object

Assuming the Account Object is mapped above, open the page layout for Account Object. In the filter field, type NiceCTI and drag and drop the object onto the Account Object layout page. nice-cti

Configure a Visualforce Page to embed the Agent AI Widget (If Applicable)

Step-1: Create a Lightning Out App

Create a Lightning Out app, a special type of standalone Aura app:
  1. Open the Developer Console from your Salesforce org.
  2. Navigate to File > New > Lightning Application.
  3. Fill in the Name and Description fields, and then click Submit.
  4. Paste the following code into the editor, and save the Lightning Application:

Step-2: Create/Edit Visualforce Page

  1. Either create a new Visualforce Page or open an existing one.
  2. To create a new Visualforce Page, navigate to the Setup page > Visualforce Pages, and click New.
  3. In the Visualforce Markup code editor, add <apex:includeLightning /> at the beginning of your Visualforce page. This component loads the JavaScript file that Lightning Components for Visualforce uses.
  4. Paste the following code into the Visualforce Markup code editor at the desired location where you want the Agent AI widget to appear:
    Replace LightningApplication with the name of the Lightning Out app you created in Step-1. Modify the height and width of the niceCTIAgentAssistVoice component according to your preference - these are the height and width of the Agent AI widget.
  5. Click Save.
Sample Visualforce Page:
Set this Visualforce page as the screen pop-up in the Softphone layouts of your Salesforce org, or create a Visualforce tab by following the instructions in this document.

Configure an Aura Component to embed the Agent AI widget (If Applicable)

  1. Either create a new Aura Component or open an existing one.
  2. To create a new Aura Component, open Developer Console from your Salesforce org.
  3. In the Developer Console, navigate to File > New > LightningComponent.
  4. Fill in the Name and Description fields, and then click Submit.
  5. Paste the following code into the editor at the desired location where you want the Agent AI widget to appear, and save the Lightning Application:
    Modify the height and width of the niceCTIAgentAssistVoice component according to your preference-these are the height and width of the Agent AI widget.
Sample Aura Component:
Create a Lightning tab by following the instructions in this document.

Enabling OAuth

  1. Go to Setup > OAuth and OpenID Connect Settings and enable Allow OAuth Username-Password Flows. enable-allow-oauth-password
  2. Create a connected Salesforce app and get the Access Key and Access Token. Follow this guide for help.

Additional Setup Steps for Chat

In addition to all the previous steps, two more steps are required for the Chat setup:

NICE API credentials to be configured for Signaling API (Only for Chat)

Refer to Manage Access Keys to create access keys to use for signaling APIs. The Access Key Manager page allows you to view all the access keys in your system. access-key-manager

Configure NICE API Credentials (Only for Chat)

  1. Click the app launcher.
  2. Type nice in the search box, and select Nice Signal Credentials from the displayed list. nice-signal
  3. Click New from the top-right corner of the page.
  4. Add the required parameters:
    • Credentials Set Name: NICE CX credentials (change as needed)
    • Proxy Tunnel Endpoint: {Agent AI URL}/integrations/nice/relay/toNice
    • NICE CX Credentials:
      • Nice Token Base URL: NICE Token Base URL is the Host URL of the login page.
      • Nice API URL: If the URL for ACD is https://home-abc.nice-incontact.com, then the API URL would be https://api-abc.nice-incontact.com. Use the URL without the trailing slash.
      • NiceCX Signal API Access Key (generated in the above step)
      • NiceCX Signal API Access Key Secret (generated in the above step)
  5. Click Save.

NICE CTI Studio Script for Salesforce

For Voice

Import and configure the NICE Studio Script for Salesforce Integration. Download Script For Voice: xml script or json script nice-cti-studio Open the Studio, import the above script, and customize as per the following table definition: AgentAssist Hub Reference: Click the checkbox on the specific instance. Only one can be active. agent-assist-hub-reference After selecting the AgentAssist app, click the Close button in the bottom-right corner of the page.
Don’t click the X button to close the window, as this won’t save the changes.
Save the Studio Script and make sure there are no errors on Save.

For Chat

Import and configure the NICE Studio Script for Salesforce Integration. Download Script For Chat: xml script or json script nice-studio-script-for-chat nice-studio-script-for-chat Open the Studio, import the above script, and customize as per the following table definition:

NICE Account setup for Incoming Phone Call/Chat

On the NICE Incontact home page, click the application launcher button and select ACD. Create a Campaign create-campaign Create a Skill create-skill Create a Disposition create-disposition Create a new single Point of Contact (For Voice)
  • Media Type - Phone Call
  • Name - Provide a name for the contact
  • Point of Contact - Select a provisioned NICE phone number.
  • Skill - Select a predefined skill, else create one and select here.
  • Script - From the dropdown list, select the studio script created for Salesforce-NICE CTI above.
  • IVR Reporting Enabled - Select the checkbox.
  • Click Create Point of Contact to save it. create-point-of-contact
Create a new single Point of Contact (For Chat)
  • Media Type - Chat
  • Name - Provide a name for the contact
  • Skill - Select a predefined skill, else create one and select here.
  • Script - From the dropdown list, select the studio script created for Salesforce-NICE CTI above.
  • IVR Reporting Enabled - Select the checkbox.
  • Click the Create Point of Contact button to save it. create-point-of-contact2

Make a Test Call / Chat

  1. Sign in to the Agent AI account and prepare an AI Agent to handle agents’ queries.
  2. Validate the AI Agent credentials are correctly mapped in the above settings.
  3. Validate the AgentAssist URL is correctly mapped in the above settings.
  4. Sign in to the NICE-InContact account, and check if the point of contact is properly configured.
  5. Sign in to your Salesforce org.
  6. From the app launcher, select Service Console.
  7. Sign in with NICE CX credentials for the agent.
  8. Install the softphone: https://help.nice-incontact.com/content/agent/cxoneagent/addcxawebrtcext.htm install-softphone
  9. Refresh the screen, and click the phone icon on the status bar.
  10. Select Integrated Softphone, and click Connect. integrated-softphone-connect
  11. Change the status to Available. status-available status-available2
For Call:
  1. Dial the Point of Contact phone number.
  2. Accept the call. accept-a-call
    1. The Contact page appears. contact-page
  3. When the End button is clicked, the Summary is generated and displayed on the Agent AI widget. summary-generation
  4. Upon clicking the Submit button on the Agent AI widget, the Summary is stored in the Agent AI Conversation Summaries. kore-agentai-conversation-summary
For Chat:
  1. In the Salesforce App Launcher, search for Nice Chats Handler and select it. nice-chat-handlers
    1. The following page opens and monitors active chats. It remains open for the Agent AI widget to render when an agent accepts a chat request. active-chat
  2. Make a chat request by opening the Point of Contact link in the browser. point-of-contact-chat
  3. Send a message, and the chat request is sent to the agent. chat-request
  4. Click Accept. accept-a-chat
  5. The Agent AI widget opens for the ongoing chat conversation. chat-conversation-page
  6. When the End button is clicked, the Summary is generated and displayed on the Agent AI widget. chat-summary
  7. Upon clicking the Submit button in the Agent AI widget, the Summary is stored in the Agent AI Conversation Summaries. chat-summary-in-agentai
  8. When Disposition is selected and clicked Save, the Chat transcript is stored in Salesforce. chat-transcript-in-salesforce chat-summary-in-salesforce