NixxisDirectLink API

NixxisDirectLink API

Introduction 
This article gives an overview on how to use the NixxisDirectLink javascript. 
The NixxisDirectLink is subject to changes without prior announcement. 
This article is based on NixxisDirectLink build 8. 

1.    Integration 
1.1.  Overview 
A basic integration of the NixxiDirectLink has the following parts: 
1. Adding the ‘NixxisDirectLink.js’ to a web script. 
2. Initiating the link. 
3. Using the commands. 
4. Setting up the script url in the administator 

1.2. Adding NixxisDirectLink to a web page 
This can be done using the default way of adding javascript to a html page with the tag 
‘script’. 

The complete line looks like this: 

<script type="text/javascript" src="NixxisDirectLink.js" ></script

See ‘Full html example’ in the Appendix below for more information.

1.3.  Initiating the link 
On the ‘onload’ of the page the NixxisDirectLink has to be initiated: 

<script type="text/javascript" > 
function InitPage() 
 
  var _Location = window.document.URL; 
  var _Parameters = _Location.substring(_Location.indexOf('?') + 1, _Location.length); 
var _Values = _Parameters.split("&"); 
  for (var i = 0; i < _Values.length; i++)  
 
  var _Pair = _Values[i].split("="); 
if (_Pair[0].toLowerCase() == "seid") {  NixxisDirectLink.sessionId = _Pair[1]; 
 
  else if (_Pair[0].toLowerCase() == "ctid") { 
  NixxisDirectLink.contactId = _Pair[1]; 
 
   
 
  NixxisDirectLink.serviceUrl = "http://[NixxisApplicationServer]/agent"; 
  }

</script
 
<body onload='javascript:InitPage()'> 

The ‘NixxisDirectLink.serviceUrl’ has to be setup to point to the Nixxis Application Server on which the agent will work. 
The ‘NixxisDirectLink.sessionId’ and the ‘NixxisDirectLink.contactId’ parameter has to be passed on by the Nixxis Application server using the query string. As default the name of the parameters in the query string are for: 

SessionId: seid 
Contactid: ctid 

On how the add the parameters to the url see ‘Setting up the script url in the administrator’. 

1.4.  Using the commands 
One the link has been initiated commands can be used. For example to start recording the command is: 
Integration 

NixxisDirectLink.startRecording() 
See section ‘Commands’ below for more details 

1.5.  Setting up the script url in the administrator 
In the administrator a url can be assigned to each activity. This url can contain different variables that can be used by the script (See document ‘Administrator Script Url.doc’ for details). To be able the use the NixxisDirectLink this is how the minimum url should look like: 


The Nixxis Application server will replace the item between ‘{x}’ by their /appropriated value. 

In the admin it will look like this: 



2.    Commands
2.1  nextContact 
Overview
This command is obsolete and has been replaced by “terminateContact”. 

2.2.  terminateContact 
Overview
To close the script so the agent can take the next contact. The action to close the script will only be executed when the communication with the contact is ‘hanged up’. 

Syntax
NixxisDirectLink.terminateContact(); 

Example
<input type="button" onclick="javascript: NixxisDirectLink.terminateContact()" value="Close script" /> 

2.3  setQualification 
Overview
This function allows qualifying the contact. It is allowed to execute this command multiple times during the life of the contact. However it is only the last qualification set that will be taking into account. 

Syntax
NixxisDirectLink.setQualification( 
             string qualificationId 
              ); 
 
//Override 1: 
NixxisDirectLink.setQualification(
            string qualificationId,
            string callbackDateTime,
            string callbackPhone 
            ); 

Parameter
QualificationId 
1. The short code of the qualification as entered in the Nixxis administrator. 
2. Qualification guid as seen in the administrator database. 

CallbackDateTime 
The date and time of the callback in the format: ‘yyyyMMddhhmm’. 

CallbackPhone 
The phone number to use for the callback 

Examples
//Set the ‘Qualification1’ for this contact 
NixxisDirectLink.setQualification('Qualification1');  

//Set a callback at 27/8/2020 at 13:00 on the phone number 3223070000 
NixxisDirectLink.setQualification('QualificationCallback', '202008271300', '3223070000'); 

2.4.  startRecording 
Overview
To start the current recording. 

Syntax
NixxisDirectLink.startRecording(); 

Example
<input type="buttononclick="javascript: NixxisDirectLink.startRecording()" value="Start recording/> 

2.5.  stopRecording 
Overview
To stop the current recording. 

Syntax
NixxisDirectLink.stopRecording(); 

Example
<input type="button" onclick="javascript: NixxisDirectLink.stopRecording()" value="Stop recording" /> 

2.6.  voiceNewCall 
Overview
To initiate a consultation call or a manual call 

Syntax
NixxisDirectLink.voiceNewCall ( string destination 
); 

Parameter
destination The number to dial. 

Example
NixxisDirectLink.voiceNewCall('691'); 

2.7.  voiceConference 
Overview
To request a conference when a consultation call is active 

Syntax
NixxisDirectLink.voiceConference(); 

Example
<input type="button" onclick="javascript: NixxisDirectLink.voiceConference()" value="Conference" /> 

2.8.  voiceTransfer 
Overview
To request a transfer when a consultation call is active 

Syntax
NixxisDirectLink.voiceTransfer(); 

Example
<input type="button" onclick="javascript: NixxisDirectLink.voiceTransfer()" value="Transfer" /> 

2.9.  voiceRetrieve 
Overview
To request a retrieve of the call when a consultation or onhold is active
 
Syntax
NixxisDirectLink.voiceRetrieve(); 

Example
<input type="button" onclick="javascript: NixxisDirectLink.voiceRetrieve()" value="Retrieve" />

2.10.  setInternalId 
Overview
To associate a contact with an internalId. When the internal id has been set it cannot be changed. 

Syntax
NixxisDirectLink.setInternalId(
            string internalId 
            ) ; 
 
Parameter
internalId 
The internal id to associate with the current contact. 

Example
NixxisDirectLink. setInternalId(“695b368b401348a29bd96f92f9067023”); 

2.11.  pause 
Overview
To put the agent in pause. 

Syntax
NixxisDirectLink.pause(); 
 
//Override 1: 
NixxisDirectLink.pause(
            string pauseId 
            ) ; 

Parameter
pauseId 
The guid of the pause reason as seen in the administrator database. 

Examples
NixxisDirectLink. pause ();  
 
NixxisDirectLink. pause ('865b468b401348a29bd96f92f9067023');

3.    Appendix 
3.1.  Full html example 
HTML file
This is how a basic html file can look like: 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<head
    <title>Example NixxisDirectLink</title> 
  <script type="text/javascript" src="NixxisDirectLink.js" ></script
  <script type="text/javascript" > 
  function InitPage() 
 
   
  //To get the session id  and contact id from the query string 
  // That means that we expect to have url formated in the
admin:    //
var _Location = window.document.URL; 
  var _Parameters = _Location.substring(_Location.indexOf('?') + 1, 
_Location.length); 
  var _Values = _Parameters.split("&"); 
  for (var i = 0; i < _Values.length; i++)  
 
  var _Pair = _Values[i].split("="); 
if (_Pair[0].toLowerCase() == "seid") { 
NixxisDirectLink.sessionId = _Pair[1]; 
 
  else if (_Pair[0].toLowerCase() == "ctid") { 
  NixxisDirectLink.contactId = _Pair[1]; 
 
   
 
 
  //Set here the Nixxis apllication server 
  NixxisDirectLink.serviceUrl = "http://[NixxisApplicationServer]/agent"
 
</script
</head
<body onload='javascript:InitPage()'> 
    <input type="button" onclick="javascript:NixxisDirectLink.setQualification('12345')" value="Set qualification" /> 
  <input type="button" onclick="javascript:NixxisDirectLink.nextContact()" value="Close script and wait for next contact" /> 
</body
</html

Parameters
There are 3 parameters required:
 
1. NixxisDirectLink.sessionId: the session id that will be passed on by the application server in the query string.  
2. NixxisDirectLink.contactId: the contact id that will be passed on by the application server in the query string 
3. NixxisDirectLink.serviceUrl: the location of the Nixxis Apllication Server. 

The first two parameter will be part of the query string of the url that need to be setup in the Nixxis administrator. 
    • Related Articles

    • Recording Modes

      Introduction The purpose of this article is to provide information on how to setup the different recording modes available in Nixxis Contact Suite. 1. Recording settings in config files RecordingMode in Http.config's admin section is a combination of ...
    • API ContextData

      Nixxis ContextData API Introduction The goal of this document is to explain how to use the NCS ContextData API. This API allows reading and writing different kinds of data hosted by the Nixxis Application Server. How to access the API The API allows ...
    • Contact History - V3.X

      Introduction This article aims to describe the functionnality of the Contact History option in the agent interface. Administration section First, the option "Allow recording playback for history" needs to be activated at the general settings at ...
    • Contact History - V2.4.X

      Introduction This article aims to describe the functionnality of the Contact History option in the agent interface. Administration section First, the option "Allow recording playback for history" needs to be activated at the general settings at ...
    • Nixxis Contact Suite - First steps guideline V3.0

      1.    Introduction  The purpose of this article is to provide the information you need to connect and configure a basic NCS environment via Nixxis Clients Desktop.  2.    Download Nixxis Client Desktop  Nixxis Client Desktop 3.0 is available ...