NICE CXOne and Mindful integration guide
Integrate Mindful services with NICE CXOne.
This guide provides instructions for integrating Mindful with NICE CXOne. Each step in the integration process will be demonstrated through examples that can be used as templates for your specific integration.
Overview
Definitions and acronyms
Call flows
Configure Mindful
Configure NICE CXOne
Enable OAuth API requests
Create a new inbound sub script for Mindful
Modify the inbound queuing script in NICE Studio to use Mindful logic
Create a return-call routing script in NICE Studio
(Optional) Configure second chance callback
Callback offers are made in the NICE CXOne inbound sub script rather than Mindful.
This guide assumes the use of a secure SIP trunk between both platforms with Secure RTP (SRTP) for voice traffic.
The configuration in this guide is an example and may be used as a template for integrating with Mindful. Any sample code in this guide should not be considered ready for production.
Definitions and acronyms
Term | Description |
---|---|
ANI (or CLI) | Automatic Number Identification is the number of the caller, also known as Calling Line Identification in some markets. |
API | An Application Programming Interface is a set of functions that allows applications to request service from other applications. |
DID | Direct Inward Dialing phone number |
DNIS | The Dialed Number Identification Service is the number of the callee (typically the number that is being dialed) in a voice call. |
Mindful Callback | A part of the Mindful platform that provides the capability to request and receive callbacks. |
Integration Hub | A NICE CXOne component used to manage third-party integrations |
Datastore | This service adds the capability to store and retrieve custom data when registering a callback in Mindful. |
Scheduler | A feature of Mindful that allows callbacks to be requested via API from other applications and platforms |
shouldOffer | The KVP returned from the Mindful GetOffer API that will be analyzed to decide whether to route a call to Mindful or transfer to an agent |
PSTN | The public circuit-switched telephone network |
RTP/SRTP | Real-time Transport Protocol is a network protocol used to deliver audio and video over IP networks. SRTP is the secure (encrypted) version of RTP. |
SIP | Session Initiation Protocol is a signaling protocol used in IP communications. |
TFN | Toll-free number |
TLS | Transport Layer Security is an encryption protocol used for secure SIP signaling between two endpoints. |
TTS | Text-to-speech |
Call flows
Inbound call flow
A customer places a call into the NICE contact center.
The DNIS is matched to the campaign associated with the inbound sub script.
After checking the status of Mindful, the EWT, and the caller's preference for the callback option, the inbound sub script posts required and optional user data to Mindful Datastore.
The call is transferred back out to the SIP number provisioned for the relevant Mindful Call Target via the TLS SIP trunk between NICE and Mindful, with required and optional SIP headers.
If any of the following conditions occur, the call will queue to the agent skill at normal priority instead of being transferred to Mindful:
The Mindful API indicates that an offer should not be made.
The EWT is below the configured threshold.
The caller declines the callback option.
There is an error in the sub script.
Return-call (callback) call flow
Mindful initiates a call to the customer's callback number. The customer presses 1 to speak to an agent.
Mindful calls the contact center number for callbacks via the TLS trunk between Mindful and NICE CXOne.
The DNIS of the agent leg is matched to the campaign associated with the callback sub script.
The callback sub script optionally retrieves custom SIP headers and/or gets the user data from Mindful Datastore using a query action, with the caller's ANI passed in as the search key.
The call queues to the agent skill at a higher priority than inbound calls.
The callback-return CXOne script invokes the Mindful Agent Answer API to inform Mindful that the agent has connected to the call.
Configure the Mindful platform
Before your ACD can send inbound calls to Mindful, there are a few items that must be configured on the Mindful side:
At least one Call Target to register and dial callbacks
A Data Set Template in Mindful Datastore (if you intend to use Datastore to store custom user data and context)
There are a few settings in Callback that must be adjusted to integrate with your ACD:
Registration
Callback > Call Targets > Your Call Target > General tab > Registration
- Offer ASAP Callback — Select this checkbox to offer callbacks to be returned as soon as possible.
- Offer Scheduled Callback — Select one or both of these checkboxes (Voice and/or Widget/API) if you wish to offer callback scheduling for specific dates and times.
Contact Center
Voice > Call Targets > Your Call Target > General tab > Contact Center
- Callback Telephony Type — Select "SIP".
- Callback Number — This will be configured in a later step.
Callback Strategy
Voice > Call Targets > Your Call Target > General tab > Callback Strategy
Most of the Callback Strategy settings are not relevant to the integration, and they can be set however you would like. However, there is one notable exception when using the Customer First Callback Strategy.
When using Customer First, enable Wait for live Agent. This will prompt agents to press a digit to accept a callback, which provides an Agent Answer event to Mindful. The Agent Answer events assist in calculating an accurate Estimated Callback Time (ECBT).
Phone Numbers
Configuration > Phone Numbers
On the Phone Numbers page, provision as many SIP numbers as needed and assign a number to each Call Target in your Organization. This is the number to use when configuring the SIP endpoint to which to send inbound calls for callback treatment.
Datastore configuration
Mindful Datastore allows you to store user data to maintain call context at critical points in an interaction. If you intend to use Datastore, you will need to perform the next few steps within the Datastore user interface.
A Data Set Template contains a collection of Data Keys that allows the Mindful Datastore to store customer data during the callback request process. This collection includes:
The set's name and description
How long you want to retain collected data submitted with this Data Set
What information you want the set to collect (through configuration of Data Keys)
The API token that is used to associate data submitted via POST requests and return information via GET requests
The Mindful Solution Delivery team can assist with setting up a Data Set Template, as well as a unique authentication token. To create one on your own, use the steps below.
On the Data Set Templates page (Datastore > Data Set Templates), click Add Data Set Template. This takes you to the New Data Set Template page.
Name — Enter a name that will be recognizable to others in your organization.
Description — Enter a description for the benefit of other Administrators.
Data Retention Period (Hours) — Manually enter or use the +/- buttons to customize your Data Retention Period. You can retain data for 1 hour, or for up to 48 hours.
API Token — The system automatically generates your API Token.
Important: If your API Token is already plugged into your routing logic, regenerating the token here will break that link. To re-establish the link, update your host with the new API Token. Contact Mindful Support for assistance.Template Data Keys — You can select from existing Data Keys in your system or add new keys. The selected keys will filter out any submitted data that does not correspond to one of the configured keys, and will only retain submitted data that matches the configured keys.
Click Add Template Data Key. This opens the New Template Data Key modal window.
- Click in the Manually Enter Data Keys field.
If your Mindful Datastore instance contains existing Data Keys, select one from the dropdown list that appears.
If not, type the name of a new Data Key here.
When finished, click Add.
Your key will now appear in the Template Data Keys list.
Example
In our example integration, we set up the following Data Keys for callbacks:
- FirstName
- LastName
- AccNum
- CallId
You can configure Data Keys in the same way for any user data that you need to maintain in your environment.
With the Mindful Datastore integration already enabled for your Organization, you can now enable it for individual Call Targets. Complete the following steps for all Call Targets within your Organization:
Open Call Targets > Your Call Target > General tab > Mindful Datastore Integration.
Select the Mindful Datastore Integration checkbox to reveal additional settings below.
In the Data Set Template field, select the Template that you created in a previous step.
Enable OAuth API requests
A few steps are required to allow CXOne scripts to send requests to the Mindful API. First, your admin account will need to be granted permission to access the Integration Hub. Next, you will need to configure a template in the Integration Hub, then configure a Mindful API request.
Admin account permissions
Before configuring the OAuth integration, make sure that your administrator account has "Automation and AI" permissions enabled:
In the CXOne admin portal, open the Roles & Permissions page.
Click the administrator account, then open the Permissions tab.
Open the Automation and AI sub-tab, then toggle the Launch Automation & AI switch on.
Save the changes when finished.
Integration Hub
With the appropriate permissions in place, you can now configure the Integration Hub:
Open the Applications menu near the top-left corner of the page, then select "Automation and AI" from the list.
This will open the AAI Admin window.
On the Integration Hub tab, click Add Template.
Configure the basic details of the new template:
Name — Enter a descriptive name, such as Mindful APIs.
Application — Enter an application name, such as Mindful.
Integration Method — Select "REST".
Authentication Type — Select "OAuth 2.0".
Attach Icon — The icon is required, but you can upload any icon that you choose.
Configure the Authentication tab as shown below:
URL — Enter the OAuth API endpoint of the Mindful API (https://auth.getmindful.com/oauth2/token).
Method — Select "POST".
Custom Headers — Add two headers:
Content-Type — application/x-www-form-urlencoded
Authorization — Enter Basic followed by the Base64 combination of Client ID and Secret from a Mindful Application Client.
Query Parameters — Add one parameter:
grant_type — client_credentials
Media Type — Select "FormURLEncoded".
Configure a request in the Requests tab:
Agent Answer API
Request Name — Enter a descriptive name, such as AgentAnswer_API.
Trigger — Select "Studio".
With this configuration in place, you will be able to invoke the Agent Answer API endpoint in the CXOne scripts covered in the next section.
Configure NICE CXOne scripts
You will need to modify the inbound sub script and inbound queuing script, and create a new return call (callback) queuing script.
For instructions on configuring all three scripts, see NICE CXOne scripts, then return to this guide when finished.
(Optional) Configure second chance callback
Second chance callback offers callers the opportunity to receive a callback after they initially decline the offer in the inbound sub script. This option is presented while the call is in the queue, as part of the announcements played during the wait.
The logic for second chance callback is mostly a modification to the queuing part of the inbound queuing script. A typical queuing script would have the Reqagent action target a skill, followed by a Music action and then maybe an announcement (Play action), and finally back to the Music action (perhaps via a brief wait step). This would normally loop until the call is answered by an agent or the caller disconnects. For example:
The diagram below assumes that the inbound queuing script logic is already implemented. This diagram begins at the point where the caller is initially offered a callback. The second-chance logic modifies the inbound queuing script, so it is more like this:
The script relies on a disposition being passed out of the Mindful sub script so that the second-chance logic will only apply if a customer has already declined a callback offer. This is important, because if the call exits the sub script for any other reason (for example, the transfer to Mindful failed or the wait time is no longer above the threshold), then the caller should not continue to receive offers.
We previously assigned the return variable for the sub script, shown here as mindfulDisposition:
This will be used with the second-chance logic, which is described below.
First, queue the call to a skill as usual using a Reqagent action. Branch this action to a Music action that plays music for a set amount of time. In this example, the SecondstoPlay parameter is set to 120 seconds:
Once the time expires, move the call to an If action:
This example If action uses an expression of mindfulDisposition = "Callback Offer Not Accepted"
. If the mindfulDisposition variable, containing the return data from the sub script, contains the string Callback Offer Not Accepted
, then it will once again invoke the Mindful sub script to offer a callback for a second time.
If the disposition is anything else, do not pass the call to the subroutine, and instead continue with the queuing loop until an agent answers or the caller disconnects.
The entire sample inbound script with Mindful logic, including second chance callback, looks like this:
When a caller accepts the second chance callback offer and leaves the queue, it may result in an Abandon statistic for that call. This should be taken into account when generating inbound call reports.
The second chance callback script logic ensures that calls exiting the Second Chance Transfer to ACD Skill module due to reaching the Max Queue Time will be transferred to Mindful. To prevent this, it is recommended to set the Max Queue Time to cover contact center queue durations and enable it when agents are unavailable or not logged in.
If a caller has accepted a callback offer, whether the initial callback offer or a second chance offer, and the transfer fails, the caller should not be offered another callback. This is reflected in the IVR script logic outlined above.
A separate Skill Transfer Module should be included for queuing to a skill with second chance callback only for calls where the caller has declined the initial callback offer.
For any other scenarios where the caller is not being transferred to Mindful, such as low Estimated Wait Time (EWT), an invalid response from the Mindful status check, script errors, or transfer errors, the call should be queued to a skill using a Skill Transfer module without the second-chance offer.
Ensure that the appropriate Skill Transfer modules are used based on the caller's response to the initial callback offer and the specific conditions encountered during the call flow.