Avaya Interaction Center CSPortal Web API SDK

Release 7.3.x Issue 1 February 2019 © 2018-2019, Avaya Inc. YOU DO NOT WISH TO ACCEPT THESE TERMS OF USE, YOU All Rights Reserved. MUST NOT ACCESS OR USE THE HOSTED SERVICE OR AUTHORIZE ANYONE TO ACCESS OR USE THE HOSTED Notice SERVICE. While reasonable efforts have been made to ensure that the Licenses information in this document is complete and accurate at the time of printing, Avaya assumes no liability for any errors. Avaya reserves THE SOFTWARE LICENSE TERMS AVAILABLE ON THE AVAYA the right to make changes and corrections to the information in this WEBSITE, HTTPS://SUPPORT.AVAYA.COM/LICENSEINFO, document without the obligation to notify any person or organization UNDER THE LINK “AVAYA SOFTWARE LICENSE TERMS (Avaya of such changes. Products)” OR SUCH SUCCESSOR SITE AS DESIGNATED BY AVAYA, ARE APPLICABLE TO ANYONE WHO DOWNLOADS, Documentation disclaimer USES AND/OR INSTALLS AVAYA SOFTWARE, PURCHASED “Documentation” means information published in varying mediums FROM AVAYA INC., ANY AVAYA AFFILIATE, OR AN AVAYA which may include product information, operating instructions and CHANNEL PARTNER (AS APPLICABLE) UNDER A COMMERCIAL performance specifications that are generally made available to users AGREEMENT WITH AVAYA OR AN AVAYA CHANNEL PARTNER. of products. Documentation does not include marketing materials. UNLESS OTHERWISE AGREED TO BY AVAYA IN WRITING, Avaya shall not be responsible for any modifications, additions, or AVAYA DOES NOT EXTEND THIS LICENSE IF THE SOFTWARE deletions to the original published version of Documentation unless WAS OBTAINED FROM ANYONE OTHER THAN AVAYA, AN AVAYA such modifications, additions, or deletions were performed by or on AFFILIATE OR AN AVAYA CHANNEL PARTNER; AVAYA the express behalf of Avaya. End User agrees to indemnify and hold RESERVES THE RIGHT TO TAKE LEGAL ACTION AGAINST YOU harmless Avaya, Avaya's agents, servants and employees against all AND ANYONE ELSE USING OR SELLING THE SOFTWARE claims, lawsuits, demands and judgments arising out of, or in WITHOUT A LICENSE. BY INSTALLING, DOWNLOADING OR connection with, subsequent modifications, additions or deletions to USING THE SOFTWARE, OR AUTHORIZING OTHERS TO DO SO, this documentation, to the extent made by End User. YOU, ON BEHALF OF YOURSELF AND THE ENTITY FOR WHOM YOU ARE INSTALLING, DOWNLOADING OR USING THE Link disclaimer SOFTWARE (HEREINAFTER REFERRED TO Avaya is not responsible for the contents or reliability of any linked INTERCHANGEABLY AS “YOU” AND “END USER”), AGREE TO websites referenced within this site or Documentation provided by THESE TERMS AND CONDITIONS AND CREATE A BINDING Avaya. Avaya is not responsible for the accuracy of any information, CONTRACT BETWEEN YOU AND AVAYA INC. OR THE statement or content provided on these sites and does not APPLICABLE AVAYA AFFILIATE (“AVAYA”). necessarily endorse the products, services, or information described Avaya grants You a license within the scope of the license types or offered within them. Avaya does not guarantee that these links will described below, with the exception of Heritage Nortel Software, for work all the time and has no control over the availability of the linked which the scope of the license is detailed below. Where the order pages. documentation does not expressly identify a license type, the Warranty applicable license will be a Designated System License as set forth below in the Designated System(s) License (DS) section as Avaya provides a limited warranty on Avaya hardware and software. applicable. The applicable number of licenses and units of capacity Refer to your sales agreement to establish the terms of the limited for which the license is granted will be one (1), unless a different warranty. In addition, Avaya’s standard warranty language, as well as number of licenses or units of capacity is specified in the information regarding support for this product while under warranty is documentation or other materials available to You. “Software” means available to Avaya customers and other parties through the Avaya computer programs in object code, provided by Avaya or an Avaya Support website: https://support.avaya.com/helpcenter/ Channel Partner, whether as stand-alone products, pre-installed on getGenericDetails?detailId=C20091120112456651010 under the link hardware products, and any upgrades, updates, patches, bug fixes, “Warranty & Product Lifecycle” or such successor site as designated or modified versions thereto. “Designated Processor” means a single by Avaya. Please note that if You acquired the product(s) from an stand-alone computing device. “Server” means a set of Designated authorized Avaya Channel Partner outside of the United States and Processors that hosts (physically or virtually) a software application Canada, the warranty is provided to You by said Avaya Channel to be accessed by multiple users. “Instance” means a single copy of Partner and not by Avaya. the Software executing at a particular time: (i) on one physical “Hosted Service” means an Avaya hosted service subscription that machine; or (ii) on one deployed software virtual machine (“VM”) or You acquire from either Avaya or an authorized Avaya Channel similar deployment. Partner (as applicable) and which is described further in Hosted SAS License types or other service description documentation regarding the applicable hosted service. If You purchase a Hosted Service subscription, the Designated System(s) License (DS). End User may install and use foregoing limited warranty may not apply but You may be entitled to each copy or an Instance of the Software only: 1) on a number of support services in connection with the Hosted Service as described Designated Processors up to the number indicated in the order; or 2) further in your service description documents for the applicable up to the number of Instances of the Software as indicated in the Hosted Service. Contact Avaya or Avaya Channel Partner (as order, Documentation, or as authorized by Avaya in writing. Avaya applicable) for more information. may require the Designated Processor(s) to be identified in the order by type, serial number, feature key, Instance, location or other Hosted Service specific designation, or to be provided by End User to Avaya through THE FOLLOWING APPLIES ONLY IF YOU PURCHASE AN AVAYA electronic means established by Avaya specifically for this purpose. HOSTED SERVICE SUBSCRIPTION FROM AVAYA OR AN AVAYA Concurrent User License (CU). End User may install and use the CHANNEL PARTNER (AS APPLICABLE), THE TERMS OF USE Software on multiple Designated Processors or one or more Servers, FOR HOSTED SERVICES ARE AVAILABLE ON THE AVAYA so long as only the licensed number of Units are accessing and using WEBSITE, HTTPS://SUPPORT.AVAYA.COM/LICENSEINFO UNDER the Software at any given time. A “Unit” means the unit on which THE LINK “Avaya Terms of Use for Hosted Services” OR SUCH Avaya, at its sole discretion, bases the pricing of its licenses and can SUCCESSOR SITE AS DESIGNATED BY AVAYA, AND ARE be, without limitation, an agent, port or user, an e-mail or voice mail APPLICABLE TO ANYONE WHO ACCESSES OR USES THE account in the name of a person or corporate function (e.g., HOSTED SERVICE. BY ACCESSING OR USING THE HOSTED webmaster or helpdesk), or a directory entry in the administrative SERVICE, OR AUTHORIZING OTHERS TO DO SO, YOU, ON database utilized by the Software that permits one user to interface BEHALF OF YOURSELF AND THE ENTITY FOR WHOM YOU ARE with the Software. Units may be linked to a specific, identified Server DOING SO (HEREINAFTER REFERRED TO INTERCHANGEABLY or an Instance of the Software. AS “YOU” AND “END USER”), AGREE TO THE TERMS OF USE. IF YOU ARE ACCEPTING THE TERMS OF USE ON BEHALF A Copyright COMPANY OR OTHER LEGAL ENTITY, YOU REPRESENT THAT Except where expressly stated otherwise, no use should be made of YOU HAVE THE AUTHORITY TO BIND SUCH ENTITY TO THESE materials on this site, the Documentation, Software, Hosted Service, TERMS OF USE. IF YOU DO NOT HAVE SUCH AUTHORITY, OR IF or hardware provided by Avaya. All content on this site, the documentation, Hosted Service, and the product provided by Avaya result in substantial additional charges for your telecommunications including the selection, arrangement and design of the content is services. owned either by Avaya or its licensors and is protected by copyright Avaya Toll Fraud intervention and other intellectual property laws including the sui generis rights relating to the protection of databases. You may not modify, copy, If You suspect that You are being victimized by Toll Fraud and You reproduce, republish, upload, post, transmit or distribute in any way need technical assistance or support, call Technical Service Center any content, in whole or in part, including any code and software Toll Fraud Intervention Hotline at +1-800-643-2353 for the United unless expressly authorized by Avaya. Unauthorized reproduction, States and Canada. For additional support telephone numbers, see transmission, dissemination, storage, and or use without the express the Avaya Support website: https://support.avaya.com or such written consent of Avaya can be a criminal, as well as a civil offense successor site as designated by Avaya. under the applicable law. Downloading Documentation Virtualization For the most current versions of Documentation, see the Avaya The following applies if the product is deployed on a virtual machine. Support website: https://support.avaya.com, or such successor site Each product has its own ordering code and license types. Note, as designated by Avaya. unless otherwise stated, that each Instance of a product must be separately licensed and ordered. For example, if the end user Contact Avaya Support customer or Avaya Channel Partner would like to install two See the Avaya Support website: https://support.avaya.com for Instances of the same type of products, then two products of that product or Hosted Service notices and articles, or to report a problem type must be ordered. with your Avaya product or Hosted Service. For a list of support Third Party Components telephone numbers and contact addresses, go to the Avaya Support website: https://support.avaya.com (or such successor site as “Third Party Components” mean certain software programs or designated by Avaya), scroll to the bottom of the page, and select portions thereof included in the Software or Hosted Service may Contact Avaya Support. contain software (including open source software) distributed under third party agreements (“Third Party Components”), which contain Trademarks terms regarding the rights to use certain portions of the Software The trademarks, logos and service marks (“Marks”) displayed in this (“Third Party Terms”). As required, information regarding distributed site, the Documentation, Hosted Service(s), and product(s) provided Linux OS source code (for those products that have distributed Linux by Avaya are the registered or unregistered Marks of Avaya, its OS source code) and identifying the copyright holders of the Third affiliates, its licensors, its suppliers, or other third parties. Users are Party Components and the Third Party Terms that apply is available not permitted to use such Marks without prior written consent from in the products, Documentation or on Avaya’s website at: https:// Avaya or such third party which may own the Mark. Nothing support.avaya.com/Copyright or such successor site as designated contained in this site, the Documentation, Hosted Service(s) and by Avaya. The open source software license terms provided as Third product(s) should be construed as granting, by implication, estoppel, Party Terms are consistent with the license rights granted in these or otherwise, any license or right in and to the Marks without the Software License Terms, and may contain additional rights benefiting express written permission of Avaya or the applicable third party. You, such as modification and distribution of the open source software. The Third Party Terms shall take precedence over these Avaya is a registered trademark of Avaya Inc. Software License Terms, solely with respect to the applicable Third All non-Avaya trademarks are the property of their respective owners. Party Components to the extent that these Software License Terms Linux® is the registered trademark of Linus Torvalds in the U.S. and impose greater restrictions on You than the applicable Third Party other countries. Terms. The following applies only if the H.264 (AVC) codec is distributed with the product. THIS PRODUCT IS LICENSED UNDER THE AVC PATENT PORTFOLIO LICENSE FOR THE PERSONAL USE OF A CONSUMER OR OTHER USES IN WHICH IT DOES NOT RECEIVE REMUNERATION TO (i) ENCODE VIDEO IN COMPLIANCE WITH THE AVC STANDARD (“AVC VIDEO”) AND/OR (ii) DECODE AVC VIDEO THAT WAS ENCODED BY A CONSUMER ENGAGED IN A PERSONAL ACTIVITY AND/OR WAS OBTAINED FROM A VIDEO PROVIDER LICENSED TO PROVIDE AVC VIDEO. NO LICENSE IS GRANTED OR SHALL BE IMPLIED FOR ANY OTHER USE. ADDITIONAL INFORMATION MAY BE OBTAINED FROM MPEG LA, L.L.C. SEE HTTP://WWW.MPEGLA.COM. Service Provider THE FOLLOWING APPLIES TO AVAYA CHANNEL PARTNER’S HOSTING OF AVAYA PRODUCTS OR SERVICES. THE PRODUCT OR HOSTED SERVICE MAY USE THIRD PARTY COMPONENTS SUBJECT TO THIRD PARTY TERMS AND REQUIRE A SERVICE PROVIDER TO BE INDEPENDENTLY LICENSED DIRECTLY FROM THE THIRD PARTY SUPPLIER. AN AVAYA CHANNEL PARTNER’S HOSTING OF AVAYA PRODUCTS MUST BE AUTHORIZED IN WRITING BY AVAYA AND IF THOSE HOSTED PRODUCTS USE OR EMBED CERTAIN THIRD PARTY SOFTWARE, INCLUDING BUT NOT LIMITED TO MICROSOFT SOFTWARE OR CODECS, THE AVAYA CHANNEL PARTNER IS REQUIRED TO INDEPENDENTLY OBTAIN ANY APPLICABLE LICENSE AGREEMENTS, AT THE AVAYA CHANNEL PARTNER’S EXPENSE, DIRECTLY FROM THE APPLICABLE THIRD PARTY SUPPLIER. Preventing Toll Fraud “Toll Fraud” is the unauthorized use of your telecommunications system by an unauthorized party (for example, a person who is not a corporate employee, agent, subcontractor, or is not working on your company's behalf). Be aware that there can be a risk of Toll Fraud associated with your system and that, if Toll Fraud occurs, it can Contents

Chapter 1: Introduction...... 6 Purpose...... 6 Intended audience...... 6 Related resources...... 6 Documentation...... 6 Training...... 10 Avaya Mentor videos...... 10 Support...... 10 Chapter 2: Overview...... 12 Feature Comparison...... 12 Prerequisites...... 12 Limitations...... 13 Migrating the IC public website to CSPortal...... 13 Chapter 3: Architecture...... 14 CSPortal architecture...... 14 Chapter 4: Deploying CSPortal...... 16 CSPortal Deployment ...... 16 CSPortal Server...... 16 CSPortal WebAPI server side deployment...... 16 Deploying CSPortal on the IC website...... 16 EWT in chat messages...... 17 Enable/Disable Service Class EWT status on Website...... 17 CSPortal Client...... 18 CSPortal WebAPI client side deployment...... 18 Deploy CSPortal WebAPI Client on Apache HTTP/HTPPS...... 18 Deploying CSPortal WebAPI Client on IIS...... 22 Chapter 5: Uninstalling CSPortal...... 23 Uninstalling CSPortal...... 23 Chapter 6: API Documentation...... 24 Introduction...... 24 REST API Facade...... 24 Multi tenancy and localization API ...... 24 Guest Authentication APIs...... 26 Escalation APIs...... 29 Survey API ...... 38 Estimated Wait Time (EWT) API...... 40 CometD Chat API...... 41 JS SDK (WebAPI)...... 45 Customization options and examples...... 53

February 2019 Avaya Interaction Center CSPortal Web API SDK 4 Comments on this document? [email protected] Contents

Embed WebSDK API...... 53 Loading sequence...... 53 Auto login...... 54 Proactive chat...... 54 Multi-tab support in chat...... 54 Chapter 7: Android Sample App...... 55 Set up your environment...... 55 Steps to Import Project in Android Studio...... 55 Steps to Build Project in Android Studio...... 55 Steps to install sample app on Android device...... 56 Sample Code Walkthrough...... 56 Glossary...... 58

February 2019 Avaya Interaction Center CSPortal Web API SDK 5 Comments on this document? [email protected] Chapter 1: Introduction

Purpose The purpose of this document is to provide detailed information about APIs for building and customizing Web Collaboration channels for Avaya Interaction Center. The APIs are provided as JS SDK and will be referred as WebAPI. Using the WebAPI, the Web based clients can escalate various collaboration options, such as , LiveChat, and Schedule Call Back available in Avaya Interaction Center.

Intended audience The audience for this document includes: • Avaya Interaction Center R&D (Developers and SV) • Avaya Professional Services • Business Partners • Avaya Sales

Related resources

Documentation The following table lists the documents related to APIs for building and customizing Web Collaboration channels for Avaya Interaction Center. Download the documents from the Avaya Support website at http://support.avaya.com/.

Title Description Audience Avaya Interaction Center and This document describes tested Sales Engineers Avaya Operational Analyst Interaction Center (IC) and Supervisors Overview and Specification Operational Analyst (OA) Table continues…

February 2019 Avaya Interaction Center CSPortal Web API SDK 6 Comments on this document? [email protected] Related resources

characteristics and capabilities, Business Partners including feature descriptions, Customers interoperability, performance specifications, security, and licensing requirements. IC Installation Planning and This guide provides detailed Business partners Prerequisites information about the planning Customers and third-party software required to deploy an Avaya Interaction Implementation engineers Center Release 7.3.x system. IC Installation and Configuration This guide provides detailed Sales Engineers information about how to install Supervisors and configure an out-of-the-box Avaya Interaction Center Release Business Partners 7.3.x. Administrators Agent User Guide This guide provides agent-related Sales Engineers information about Avaya Supervisors Interaction Center Agent. Business Partners Customers Agents Avaya Agent Web Client This guide provides the Sales Engineers information about Avaya Agent Supervisors Web Client. Business Partners Customers Agents IC Administration Guide This guide provides detailed Sales Engineers information about Avaya Supervisors Interaction Center (Avaya IC). This guide describes domain and Business Partners server administration using Avaya Customers IC Manager. Administrators IC Client SDK Guide This guide provides detailed Sales Engineers information about the Client Business Partners Software Development Kit (Client SDK) for Avaya Interaction Center Implementation Engineers Release 7.3.x. IC Client and Server Programmer This guide provides detailed Sales Engineers Design Guide information about Avaya Business Partners Interaction Center (Avaya IC). The purpose of this guide is also Implementation Engineers to provide an overview of the Table continues…

February 2019 Avaya Interaction Center CSPortal Web API SDK 7 Comments on this document? [email protected] Introduction

Avaya IC ORB Toolkit, and a list of components in the Avaya IC product set. Using Config Accelerator This guide provides detailed Sales Engineers information about how to use Supervisors Config Accelerator for simplifying and accelerating the configuration Business Partners process of Avaya Interaction Customers Center 7.3.x. Administrators IC Alarms Guide This guide provides detailed Sales Engineers information about Avaya Supervisors Interaction Center alarms. Business Partners Customers Administrators IC Database Designer Application This guide provides detailed Sales Engineers Reference information about Avaya Business Partners Interaction Center (IC). This guide describes the prerequisites for Implementation Engineers installing and configuring Avaya IC. Agent Web Client Customization This guide provides detailed Sales Engineers information about how to Business Partners customize Avaya Agent Web Client. Implementation Engineers IC Business Advocate This guide provides detailed Sales Engineers Configuration and Administration information about Avaya Supervisors Interaction Center (IC) 7.3.x. This guide describes the Business Partners administration and configuration Administrators of Avaya Business Advocate. IC Workflow Designer User Guide This guide provides detailed Sales Engineers information about Avaya Supervisors Workflow Designer and how to use Workflow Designer to create Business Partners and customize workflows for Customers Avaya Interaction Center Release 7.3.x. Agents IC Media Workflow Reference This guide provides detailed Sales Engineers information about the blocks you Supervisors can use with media workflows and other reference information to Business Partners help you understand and Administrators customize media workflows for Table continues…

February 2019 Avaya Interaction Center CSPortal Web API SDK 8 Comments on this document? [email protected] Related resources

Avaya Interaction Center Release 7.3.x. Agent Script Workflow Reference This guide provides detailed Sales Engineers information about the blocks you Supervisors can use with agent script workflows and other reference Business Partners information to help you Administrators understand and create agent script workflows for Avaya Interaction Center Release 7.3.x. IC Workflow API Reference This guide provides information Sales Engineers about the extensions and Business Partners methods specific to the Application Programming Implementation Engineers Interface (API) for workflow blocks in Avaya Interaction Center Release 7.3.x. Agent Data Unit Server This guide provides detailed Sales Engineers Programmer Guide information about configuring and Business Partners managing the Agent Data Unit (ADU) server, which is Implementation Engineers responsible for tracking the state of agents at the contact center. Core Services Programmer Guide This guide provides detailed Sales Engineers information for programming and Business Partners changing the configuration of your IC Core Services. Implementation Engineers Electronic Data Unit Server This guide provides provide Sales Engineers Programmer Guide detailed information about the Business Partners Electronic Data Unit (EDU) server, which was previously Implementation Engineers named the Voice Data Unit (VDU) server, the EDU server configuration, the alarms, and the event monitoring. IC Telephony Connectors This guide describes the Avaya Sales Engineers Programmer Guide Telephony Connector server. Business Partners Implementation Engineers IC Integration with VP / IR This guide provides detailed Sales Engineers information about Avaya Business Partners Interaction Center (IC) integration with Avaya Aura® Experience Implementation Engineers Portal (EP) / Avaya Voice Portal Administrators (VP) / Avaya Interactive Response (IR).

February 2019 Avaya Interaction Center CSPortal Web API SDK 9 Comments on this document? [email protected] Introduction

Training The following courses are available on the Avaya Learning website at http:// www.avayalearning.com/. After logging into the website, enter the course code or the course title in the Search field and click Go to search for the course.

Course Code Course title ATC01175WEN IC and OA Overview ATC01176IEN Interaction Center Administration and Configuration AUCC100010695 IC-Siebel Integration ATC100011017 IC-Siebel Integration, Installation and Troubleshooting AUCC100010728 The Basics of Operational Analyst Part 1 AUCC100010729 The Basics of Operational Analyst Part 2

Avaya Mentor videos Avaya Mentor videos provide technical content on how to install, configure, and troubleshoot Avaya products. About this task Videos are available on the Avaya Support website, listed under the video document type, and on the Avaya-run channel on YouTube. • To find videos on the Avaya Support website, go to http://support.avaya.com/, select the product name, and check the videos checkbox to see a list of available videos. • To find the Avaya Mentor videos on YouTube, go to http://www.youtube.com/AvayaMentorand perform one of the following actions: - Enter a keyword or keywords in the Search Channel to search for a specific product or topic. - Scroll down Playlists, and click the name of a topic to see the available list of videos posted on the site. Note: Videos are not available for all products.

Support Visit the Avaya Support website at http://support.avaya.com/ for the most up-to-date documentation, product notices, and knowledge articles. You can also search for release notes, downloads, and resolutions to issues. Use the online service request system to create a service

February 2019 Avaya Interaction Center CSPortal Web API SDK 10 Comments on this document? [email protected] Support

request. Chat with live agents to get answers to questions, or request an agent to connect you to a support team if an issue requires additional expertise.

February 2019 Avaya Interaction Center CSPortal Web API SDK 11 Comments on this document? [email protected] Chapter 2: Overview

Feature Comparison The following table provides feature comparison between Interaction Center 7.3.2 and 7.3.3 CSPortal features:

Feature IC 7.3.2 IC 7.3.3 onwards REST API Partial (excluding Chat) Y Chat Y Y Email Y Y Chat and Callback Y Y Schedule Callback Y Y Guest login Y Y Customer Account Y Survey Y Join-us Y EWT for Chat (only Advocate) Y Multi-Tab Browser support for Y chat Proactive chat Y Mobile Application support Y

Prerequisites To understand the content of this document, you must have the operational skills for the following tools and technologies. Knowledge • HTML • CSS • JavaScript • Tomcat

February 2019 Avaya Interaction Center CSPortal Web API SDK 12 Comments on this document? [email protected] Limitations

• HTTP Cookies

Limitations The following website features are unavailable in the CSPortal website: • CIRS • FAQ-WRU • VOIP chat • Datawake • Co-Browse Limitations in the Web API and Reference implementation. • Reference implementation does not support vertical dragging of chat window.

Migrating the IC public website to CSPortal Customers using the existing IC public site and planning to migrate to the new CSPortal must revisit the customization and implement them as per the new framework. IC 7.3.3 does not support out-of-box migration of the existing IC website to the new CSPortal website.

February 2019 Avaya Interaction Center CSPortal Web API SDK 13 Comments on this document? [email protected] Chapter 3: Architecture

CSPortal architecture This section explains the high- level picture of the deployment of various components. This document covers only those components that are relevant to the custom WebChat client while summarizes others in brief. For more information on Avaya Interaction Center, see appropriate user guides on Avaya Support Site at http://support.avaya.com/ or contact Avaya Professional Services team. The following diagram shows the high-level architecture for the Custom client and various other components involved.

February 2019 Avaya Interaction Center CSPortal Web API SDK 14 Comments on this document? [email protected] CSPortal architecture

February 2019 Avaya Interaction Center CSPortal Web API SDK 15 Comments on this document? [email protected] Chapter 4: Deploying CSPortal

CSPortal Deployment The new WebAPI deployment is a two-step process. In the first step, you configure the server side components and in the second step, you set up the client side component.

CSPortal Server

CSPortal WebAPI server side deployment For more information about HTTPS deployment of Tomcat, see the Configuring SSL security for Web servers (optional) topic in the IC Installation and Configuration Guide. Note: On any IC server, you can deploy only one website. This website can either be the IC Website or the CSPortal website. If you want to deploy both the IC website and CSPortal website, you must deploy them on different IC servers.

Deploying CSPortal web application on the IC website About this task CSPortal uses the same configuration files and Avaya Interaction Center account (for example, website user) that are configured during the IC website configuration. Procedure 1. Run the Configure.bat file available on the desktop of Design & Admin machine 2. In the Avaya Interaction Center Configuration Tool window, in the Web tab, select Configure Web Management. 3. Select Website. 4. In the Web Application (Website/CSPortal), select CSPortal from the drop down list.

February 2019 Avaya Interaction Center CSPortal Web API SDK 16 Comments on this document? [email protected] CSPortal Server

5. Click Apply Settings. 6. After the settings are configured, click Exit. 7. From the Windows Services application, start the Avaya IC CSPortal Web Service 7.3 service. 8. Open a browser and access the URL http://FQDN>:9609/csportal/v1/ gettenantlist. Ensure that the browser displays a JSON formatted string listing the tenants from the IC website. Example Note: IC does not support deploying any HTML, Javascript files on the Tomcat hosting CSPortal web application.

EWT in chat messages To configure Estimated Wait Time (EWT) in the chat messages EWT needs to be enabled in WAA. Note: Chat EWT is only supported in Advocate routing. • In IC Manager, Open WAA Server configuration. • Select “Enable EWT message in Chat” option located in the WAA Tab. • Restart WAA server.

Enable/Disable Service Class EWT status on Website To configure website to provide Estimated Wait Time (EWT) of Service class, EWT needs to be enabled in Website. Note: Service class EWT on Website is only supported in Advocate routing. • On CSPortal machine, from the Windows Services application, stop the IC Web Management service • Open the web.xml file to edit from /comp/csportal/WEB-INF/ • In the following servlet code section, add the comment tag for the line shown in bold: EWTServlet com.avaya.aic.website.service.EWTServlet ewtenabled

February 2019 Avaya Interaction Center CSPortal Web API SDK 17 Comments on this document? [email protected] Deploying CSPortal

true 6

CSPortal Client

CSPortal WebAPI client side deployment This deployment is similar to real world deployment where Web resources, such as JS, CSS, and images are hosted by different domain, such as CDN or Web Server in DMZ. For the test setup, you can use the other domain as your system running a web server, such as Apache/httpd or IIS. Following is the deployment example on the Apache HTTP server.

Deploy CSPortal WebAPI Client on Apache HTTP/HTPPS Prerequisites The Apache HTTP server installed and configured. For more information on installing and configuring Apache HTTP server, see https:// httpd.apache.org/. Related links Deploying WebAPI SDK and reference implementation on Apache HTTP on page 18 Deploying WebAPI SDK and reference implementation on Apache HTTPS on page 19 Additional security settings on page 21 Deploying WebAPI SDK and reference implementation on Apache HTTP Procedure 1. From the IC_INSTALL_HOME\design\csportalclient directory on the IC Design and Admin system, copy the sdk and refimplementation folders to the Document Root of the Apache server.

From To \design\csportalclient\sdk \htdocs\aic\sdk \design\csportalclient \htdocs\aic\refimplementation \refimplementation 2. Open the /conf/httpd.conf configuration file to edit.

February 2019 Avaya Interaction Center CSPortal Web API SDK 18 Comments on this document? [email protected] CSPortal Client

3. In the file, remove the comment tags from the following modules: LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule rewrite_module modules/mod_rewrite.so 4. Add the following lines at the end of the file. ProxyRequests off ProxyPreserveHost on ProxyPass /csportal http://:9602/csportal ProxyPassReverse /csportal http://:9602/csportal 5. Restart the Apache HTTP server. 6. Open a browser and access the URL: http:///aic/refimplementation/ demo.html. 7. Verify that the browser displays the reference implementation shipped with the Avaya Interaction Center 7.3.3 release.

Related links Deploy CSPortal WebAPI Client on Apache HTTP/HTPPS on page 18 Deploying WebAPI SDK and reference implementation on Apache HTTPS Procedure 1. Download Apache with SSL and configure as specified in above section. 2. Open the /conf/httpd.conf configuration file to edit.

February 2019 Avaya Interaction Center CSPortal Web API SDK 19 Comments on this document? [email protected] Deploying CSPortal

3. In the file, remove the comment tags from the following modules: LoadModule ssl_module modules/mod_ssl.so #below is optional only for Apache httpd 2.4 LoadModule socache_shmcb_module modules/mod_socache_shmcb.so 4. In the file, remove the comment tag for the following line: Include conf/extra/httpd-ssl.conf 5. Open the /conf/extra/httpd-ssl.conf configuration file to edit. 6. In the file, add comment tagf to following : #SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5 7. Add the following: SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL 8. Add following below “SSLPassPhraseDialog builtin”: SSLProtocol all -SSLv2 -SSLv3 9. 9. Add following below “”: SSLProxyEngine On SSLProxyVerify none SSLProxyProtocol all SSLProxyCipherSuite ALL:DHE+RSA+AES128+SHA

SSLProxyCheckPeerCN off # SSLProxyCheckPeerName directive is supported on Apache httpd 2.4 onwards SSLProxyCheckPeerName off # to tell Apache where to find CA certificates to check server certificates with: SSLProxyCACertificateFile conf/tomcat_rfc_certfile_from_keystore.crt 10. In above configuration certificate check is disabled for simplicity. You can check with the IT security team on the policy to verify and enable the certificate. 11. Add following above “”: ProxyRequests off ProxyPreserveHost on

ProxyPass /csportal https://<148.147.174.10:8443>/csportal ProxyPassReverse /csportal https://<148.147.174.10:8443>/csportal 12. In Tomcat for configuring CSPortal on HTTPS, open file server.website.xml in the tomcat/conf directory. 13. Modify connector settings as for the port number , by default, port number is 9609.

February 2019 Avaya Interaction Center CSPortal Web API SDK 20 Comments on this document? [email protected] CSPortal Client

scheme="https" secure="true"/> Related links Deploy CSPortal WebAPI Client on Apache HTTP/HTPPS on page 18 Additional security settings About this task The settings mentioned in this section are optional. Avaya recommends doing these settings to avoid any security issues that might occur when using the Apache server. Procedure 1. Disable the directory browsing. a. Search for the following code, Options Indexes FollowSymLinks. b. From the Options FollowSymLinks line, remove Indexes. 2. Limit HTTP methods. In the tag, add the tag as shown in the following code: ... Deny from all ... 3. Disable trace. In the file, add the TraceEnable off line. Example Example • [Customer ----> httpd] Incoming URL (XHR): http://customer-domain.com/csportal/v1/getuser • [httpd ------> AIC] Rewritten URL: http://aic-domain.com:9602/csportal/v1/getuser Reference http://httpd.apache.org/download.cgi http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass Related links Deploy CSPortal WebAPI Client on Apache HTTP/HTPPS on page 18

February 2019 Avaya Interaction Center CSPortal Web API SDK 21 Comments on this document? [email protected] Deploying CSPortal

Deploying CSPortal WebAPI Client on IIS Procedure 1. Copy csportalclient directory from \design location on Design and Admin machine to the location of \comp on the CSPortal website machine. 2. Start IIS Manager. 3. In Default Web Site node, add application. • Alias : csportalclient • Application Pool: DefaultAppPool • Physical Path: comp\csportalclient 4. Re-start IIS Server.

February 2019 Avaya Interaction Center CSPortal Web API SDK 22 Comments on this document? [email protected] Chapter 5: Uninstalling CSPortal

Uninstalling CSPortal Before you begin Shut down the IC website. Procedure 1. Run the Configure.bat file available on the desktop of Design and Admin machine. 2. In the Avaya Interaction Center Configuration Tool window, in the Web tab, select Configure Web Management. 3. Clear or select Website option. 4. In the Web Application, Website or CSPortal, select Website from the drop down list. 5. Click Apply Settings. 6. Click Exit. 7. If you select to deploy IC Website, then from Windows Services application, start the IC Web Management service. 8. Open a browser and access the URL, http:///website/public. 9. Ensure that the browser displays the IC public website.

February 2019 Avaya Interaction Center CSPortal Web API SDK 23 Comments on this document? [email protected] Chapter 6: API Documentation

Introduction In Avaya Interaction Center 7.3.3 release onwards, RESTful Facade is introduced to interact with core Avaya Interaction Center components from the Server, such as Website, ICM. The purpose of this layer is to abstract the functionality into layer of well-defined REST APIs which can be called by the clients over HTTP/HTTPs. JSON is used as a data format. The REST APIs are hidden by the layer of JS SDK APIs. The end-user leverages the JS WebAPI to write the client. For example, a user Website (HTML Webpage).

REST API Facade The JS-SDK API talks to REST APIs layer exposed by Avaya Interaction Center Server (Tomcat). Ensure that the REST APIs are deployed correctly.

Multi tenancy and localization API

Get /csportal/v1/gettenantlist Description: Provides Tenant list configured on the ICSystem, in the form of JSON data. Response Content Type application/json { Sample JSON data state (boolean): state, message (string): message, { data {} optional "message": "Tenant list :", } "success": true, "data": { "tenant1": "Singapore", "tenant0": "Pune", "tenant2": "DefaultTenant" } }

Get /csportal/v1/getlanguagelist Table continues…

February 2019 Avaya Interaction Center CSPortal Web API SDK 24 Comments on this document? [email protected] Multi tenancy and localization API

Description: Provides the language list for the specified tenant in the form of JSON data that is configured for the IC System. Request Parameters tenant The tenant name. if not provided, DefaultTenant will be considered as the default name. Response Content Type application/json { Sample JSON data state (boolean): state, message (string): message, { data {} optional "message": "Language List for Tenant : } DefaultTenant", "success": true, "data": { "Spanish": "es-ES", "French": "fr-FR", "Chinese": "zh-CN", "English": "en" } }

Get /csportal/v1/getlocalizedvalues Description: Provides the localized values list for the specified tenant and the language in the form of JSON data that is configured for the IC system.

Note: The API only picks the properties listed in the Localized.properties file, which is located in the csportal/WEB-INF directory. Request Parameters tenant The tenant name. If not provided, DefaultTenant will be considered as the default name. language The language name. If not provided, en will be considered as the default language. Response Content Type application/json { Sample model schema state (boolean): state, message (string): message, { data {} optional "message": "Localized resource strings } for language : en", "success": true, "data": { "pvchat.question.maxlength": "1000", "ivchat.question.default": "Enter a detailed question here.", "chat.htmlclient.chaterror.message": "[Chat connection error. Please disconnect this session]", Table continues…

February 2019 Avaya Interaction Center CSPortal Web API SDK 25 Comments on this document? [email protected] API Documentation

"chat.phrases.agentstatus": "Agent is not available in the chat", "email.question.default": "Enter a detailed question here." }}

Get /csportal/v1/gettenantescalateopts Description: Provides media options available for the specified tenant. Request Parameters tenant The tenant name. If not provided, DefaultTenant will be considered as the default name. Response Content Type application/json { Sample model schema state (boolean): state, message (string): message, { data {} optional "message": "Escalated Options", } "success": true, "data": { "LiveChat": "true", "Email": "true", "Fax": "true", "Callback": "true", "ChatAndCallback": "true", "VoipChat": "true" } }

Guest Authentication APIs

Get /csportal/v1/getuser Description: Provides status of a user. If the user is not logged in, this API provides a message that user is not logged in. For example, {"message":"User is not logged in","success":false} If the user is logged, this API provides a message that user is logged in with the user information in the data field as JSON data. The “escmediaopts” denote the media options available to the customer. For example, see the data in the following table: Response Content Type application/json { Sample data when user loggedin state (boolean): state, message (string): message, { data {} optional "message": "User returned", } "success": true, "data": { "phone": "", "location": "Other", Table continues…

February 2019 Avaya Interaction Center CSPortal Web API SDK 26 Comments on this document? [email protected] Guest Authentication APIs

"state": "loggedin", "lastname": "", "escmediaopts": { "LiveChat": "true", "Email": "true", "Fax": "true", "Callback": "true", "ChatAndCallback": "true", "VoipChat": "true" }, "city": "", "title": "", "tenant": "DefaultTenant", "role": "guest", "login": "Guest", "mangledName": "guest_Guest_70503185", "zip": "", "chatescalate": "false", "fax": "", "firstname": "", "loginhash": "", "email": "", "address": "", "company": "", "language": "en", "email_address": "" } }

POST /csportal/v1/login Provides user ability to login into the system. Note:

Currently this API supports only the guest role. Request Parameters Response Content Type application/json Request Param Body Data Model { Sample JSON data username (string): username, password (string): password, { tenant (string): tenant, "userrole": "guest", language (string): language, "username": "Guest", userrole (userRole) = 'guest' "language": "en", } "tenant": "DefaultTenant" } OR { "userrole": "customer", "username": "James", "password": "*****", "language": "en", "tenant": "DefaultTenant" } Parameter Validation username • Cannot be empty • Must be ASCII Table continues…

February 2019 Avaya Interaction Center CSPortal Web API SDK 27 Comments on this document? [email protected] API Documentation

• Must have minimum length of 3 characters and maximum length of 20 characters • Must contain alphanumeric characters only • Must have first character as alphabetic character only userrole Can only be “guest” or “customer”. tenant Valid tenant name from the system. language Valid Language for the tenant. Response Content Type application/json { Sample JSON data state (boolean): state, message (string): message, { data {} optional "message": "User loggedin successfully", } "success": true, "data": { "phone": "", "location": "Other", "state": "loggedin", "lastname": "", "escmediaopts": { "LiveChat": "true", "Email": "true", "Fax": "true", "Callback": "true", "ChatAndCallback": "true", "VoipChat": "true" }, "city": "", "title": "", "tenant": "DefaultTenant", "role": "guest", "login": "Guest", "mangledName": "guest_Guest_90988625", "zip": "", "fax": "", "firstname": "", "loginhash": "", "email": "", "address": "", "company": "", "language": "en", "email_address": "" } }

Get /csportal/v1/logout Description: Provides user the ability to logout of the system. Response Content Type application/json { Sample model schema state (boolean): state, message (string): message, { data {} optional "message": "User Logged out", } "success": true }

February 2019 Avaya Interaction Center CSPortal Web API SDK 28 Comments on this document? [email protected] Escalation APIs

Escalation APIs

POST /csportal/v1/escalatemedia Description: Provides user the ability to escalate media request to the system. Following are the supported media types: • LiveChat • Email • ChatAndCallback • Callback Request Parameters Response Content Type application/json Request Param Body Data Model { mediatype : 'LiveChat' or 'Email' or 'ChatAndCallback' or 'Callback', calltype : 'chatter' or 'joinus'(optional), agentname (string,optional): , callhandle (string,optional): , question, displayname (string):, contact (string, optional): aicaddress, subject (string, optional):, phoneno (string, optional):, faxno (string, optional):, prefresponsemethod (string, optional):, sendtranscript (boolean, optional):, sendemailto (string, optional):, eduvalues {}, callbackdata { callbackNumber (string):, areaCode (string): areacode, countryCode (string): countrycode, scheduleDateTime (string):, timeZone (string): timezone } } Response Content Type application/json { Sample model schema state (boolean): state, message (string): message, { data {} optional "state": "boolean", } "message": "string", "data": "Map[string,?]" } Sample Email Request Request Param Body Data Model { "aicaddress": "[email protected]", "displayname": "Jon doe", "mediatype": "Email", Table continues…

February 2019 Avaya Interaction Center CSPortal Web API SDK 29 Comments on this document? [email protected] API Documentation

"question": "Price of Moto G", "sendemailto": "[email protected]", "subject": "Need Help in Electronics" }

Parameter Validation mediatype Email displayname Must not be empty. Must not be more than 126 characters. subject Must not be empty. Must not be more than length specified in “email.subject.maxlength” default value is 255. question Must not be empty. Must not be more than length specified in “email.question.maxlength” default value is 1000. sendemailto Customer email id. Must not be empty. Must be valid email address format. aicaddress Avaya Interaction Center Email account polling email address. If empty, then the first email address of the Tenant provided will be used agentname Optional Sample Chat Request Request Param Body Data Model { "displayname": "Jon doe", "mediatype": "LiveChat", "calltype" : "chatter", "question": "Need help on electronics", "sendemailto": "[email protected]", "sendtranscript": true, "eduvalues": { "eduname1": "eduvalue1", "eduname2": "eduvalue2", "eduname3": "eduvalue3" } } Parameter Validation mediatype LiveChat calltype Chatter for normal chat and joinus for joinus chat. displayname Must not be empty. Must not be more than 126 characters. question Must not be empty. Table continues…

February 2019 Avaya Interaction Center CSPortal Web API SDK 30 Comments on this document? [email protected] Escalation APIs

Must not be more than the length specified in the chat.question.maxlength parameter. The default value is 1000. sendemailto Customer email id. aicaddress Avaya Interaction Center email account polling email address. If empty, then the first email address of the Tenant provided will be used. sendtranscript Boolean – True or false. agentname Optional eduvalues Optional Sample Chat and Callback Request Request Param Body Data Model { "mediatype": "ChatAndCallback", "calltype" : "chatter", "displayname": "Jon Doe", "sendemailto": "[email protected]", "sendtranscript": true, "question": "Need help in Electronics", "callbackdata": { "countrycode": "33", "areacode": "55", "callbacknumber": "12345678" } } Parameter Validation mediatype ChatAndCallback calltype Chatter for normal chat and joinus for joinus chat. displayname Must not be empty. Must not be more than 126 characters. question Must not be empty. Must not be more than the length specified in the pvchat.question.maxlength parameter. The default value is 1000. sendemailto The customer email address. Must not be empty. Must be the valid email address format. aicaddress Avaya Interaction Center email account polling email address. sendtranscript Boolean – true or false. agentname Optional eduvalues Optional Table continues…

February 2019 Avaya Interaction Center CSPortal Web API SDK 31 Comments on this document? [email protected] API Documentation

callbacknumber Must not be empty. Must contain the valid numeric characters from 0 to 9. Can contain + () and - characters. countrycode Must not be empty. Must contain the valid numeric characters from 0 to 9. Can contain + () and - characters. areacode Must not be empty. Must contain the valid numeric characters from 0 to 9. Can contain + () and - characters. Sample Schedule Callback Request Request Param Body Data Model { "mediatype": "Callback", "displayname": "Jon Doe", "question": "Need help in Electronics", "callbackdata": { "countrycode": "44", "areacode": "55", "callbacknumber": "87654321", "scheduledatetime": "2014/04/30 16:30", "timezone": "IST" } } Parameter Validation mediatype Callback. displayname Must not be empty. Must not be more than 126 characters. question Must not be empty. Must not be more than the length specified in the callback.question.maxlength parameter. The default value is 1000. agentname Optional, string eduvalues Optional, set of name value pairs of string. callbacknumber Must not be empty. Must contain the valid numeric characters from 0 to 9. Can contain + () and - characters. countrycode Must not be empty. Table continues…

February 2019 Avaya Interaction Center CSPortal Web API SDK 32 Comments on this document? [email protected] Escalation APIs

Must contain the valid numeric characters from 0 to 9. Can contain + () and - characters. areacode Must not be empty. Must contain the valid numeric characters from 0 to 9. Can contain + () and - characters. scheduledatetime Must be the valid date and time in YYYY/MM/DD HH:SS” format. For example, 2014/04/19 16:30”. timezone Must contain a time zone value from the reference table provided in the following topic.

Time zone reference table Time zone name Time zone value Afghanistan Time Asia/Kabul Alaska Daylight Time US/Alaska Alaska Standard Time SystemV/YST9YDT Alma-Ata Time Asia/Almaty Amazon Time Brazil/West Anadyr Time Asia/Anadyr Aqtau Time Asia/Aqtau Aqtobe Time Asia/Aqtobe Arabia Standard Time Asia/Riyadh Argentine Time America/Rosario Armenia Time NET Atlantic Daylight Time Canada/Atlantic Atlantic Standard Time SystemV/AST4ADT Azerbaijan Summer Time Asia/Baku Azores Summer Time Atlantic/Azores Bangladesh Time BST Bhutan Time Asia/Thimphu Bolivia Time America/La_Paz Brasilia Time Brazil/East British Summer Time GB-Eire Brunei Time Asia/Brunei Cape Verde Time Atlantic/Cape_Verde Central African Time CAT Table continues…

February 2019 Avaya Interaction Center CSPortal Web API SDK 33 Comments on this document? [email protected] API Documentation

Central Daylight Time US/Indiana-Starke Central European Summer Time Poland Central European Time Africa/Tunis Central Indonesia Time Asia/Ujung_Pandang Central Standard Time SystemV/CST6CDT Central Standard Time (Northern Territory) Australia/North Central Standard Time (South Australia) Australia/South Central Standard Time (South Australia/New South Australia/Yancowinna Wales) Central Western Standard Time (Australia) Australia/Eucla Chamorro Standard Time Pacific/Saipan Chatham Standard Time Pacific/Chatham Chile Time Chile/Continental China Standard Time PRC Choibalsan Time Asia/Choibalsan Christmas Island Time Indian/Christmas Chuuk Time Pacific/Yap Cocos Islands Time Indian/Cocos Colombia Time America/Bogota Cook Is. Time Pacific/Rarotonga Coordinated Universal Time Zulu Cuba Daylight Time Cuba Davis Time Antarctica/Davis Dumont-d'Urville Time Antarctica/DumontDUrville East Indonesia Time Asia/Jayapura Easter Is. Time Pacific/Easter Eastern African Time Indian/Mayotte Eastern Daylight Time US/Michigan Eastern European Summer Time Turkey Eastern European Time Libya Eastern Greenland Summer Time America/Scoresbysund Eastern Standard Time SystemV/EST5EDT Eastern Standard Time (New South Wales) Australia/Sydney Eastern Standard Time (Queensland) Australia/Queensland Eastern Standard Time (Tasmania) Australia/Tasmania Eastern Standard Time (Victoria) Australia/Victoria Table continues…

February 2019 Avaya Interaction Center CSPortal Web API SDK 34 Comments on this document? [email protected] Escalation APIs

Ecuador Time America/Guayaquil Falkland Is. Time Atlantic/Stanley Fernando de Noronha Time Brazil/DeNoronha Fiji Time Pacific/Fiji French Guiana Time America/Cayenne French Southern & Antarctic Lands Time Indian/Kerguelen Further-Eastern European Time Europe/Minsk GMT+00:00 GMT0 GMT+01:00 Etc/GMT-1 GMT+02:00 Etc/GMT-2 GMT+03:00 Etc/GMT-3 GMT+03:07 Mideast/Riyadh89 GMT+04:00 Etc/GMT-4 GMT+05:00 Etc/GMT-5 GMT+06:00 Etc/GMT-6 GMT+07:00 Etc/GMT-7 GMT+08:00 Etc/GMT-8 GMT+09:00 Etc/GMT-9 GMT+10:00 Etc/GMT-10 GMT+11:00 Etc/GMT-11 GMT+12:00 Etc/GMT-12 GMT+13:00 Etc/GMT-13 GMT+14:00 Etc/GMT-14 GMT-01:00 Etc/GMT+1 GMT-02:00 Etc/GMT+2 GMT-03:00 Etc/GMT+3 GMT-04:00 Etc/GMT+4 GMT-05:00 Etc/GMT+5 GMT-06:00 Etc/GMT+6 GMT-07:00 Etc/GMT+7 GMT-08:00 Etc/GMT+8 GMT-09:00 Etc/GMT+9 GMT-10:00 Etc/GMT+10 GMT-11:00 Etc/GMT+11 GMT-12:00 Etc/GMT+12 Galapagos Time Pacific/Galapagos Table continues…

February 2019 Avaya Interaction Center CSPortal Web API SDK 35 Comments on this document? [email protected] API Documentation

Gambier Time Pacific/Gambier Georgia Time Asia/Tbilisi Ghana Mean Time Africa/Accra Gilbert Is. Time Pacific/Tarawa Greenwich Mean Time Iceland Gulf Standard Time Asia/Muscat Guyana Time America/Guyana Hawaii Standard Time US/Hawaii Hawaii-Aleutian Daylight Time US/Aleutian Hong Kong Time Hongkong Hovd Time Asia/Hovd India Standard Time IST Indian Ocean Territory Time Indian/Chagos Indochina Time VST Iran Daylight Time Iran Irish Summer Time Europe/Dublin Irkutsk Time Asia/Irkutsk Israel Daylight Time Israel Japan Standard Time Japan Kirgizstan Time Asia/Bishkek Korea Standard Time ROK Kosrae Time Pacific/Kosrae Krasnoyarsk Time Asia/Krasnoyarsk Line Is. Time Pacific/Kiritimati Lord Howe Standard Time Australia/Lord_Howe Macquarie Island Time Antarctica/Macquarie Magadan Time Asia/Magadan Malaysia Time Asia/Kuching Maldives Time Indian/Maldives Marquesas Time Pacific/Marquesas Marshall Islands Time Pacific/Majuro Mauritius Time Indian/Mauritius Mawson Time Antarctica/Mawson Metlakatla Standard Time America/Metlakatla Middle Europe Summer Time MET Moscow Standard Time W-SU Table continues…

February 2019 Avaya Interaction Center CSPortal Web API SDK 36 Comments on this document? [email protected] Escalation APIs

Mountain Daylight Time US/Mountain Mountain Standard Time US/Arizona Myanmar Time Asia/Rangoon Nauru Time Pacific/Nauru Nepal Time Asia/Katmandu New Caledonia Time Pacific/Noumea New Zealand Standard Time Pacific/Auckland Newfoundland Daylight Time Canada/Newfoundland Niue Time Pacific/Niue Norfolk Time Pacific/Norfolk Novosibirsk Time Asia/Novosibirsk Omsk Time Asia/Omsk Oral Time Asia/Oral Pacific Daylight Time US/Pacific-New Pacific Standard Time SystemV/PST8PDT Pakistan Time PLT Palau Time Pacific/Palau Papua New Guinea Time Pacific/Port_Moresby Paraguay Time America/Asuncion Peru Time America/Lima Petropavlovsk-Kamchatski Time Asia/Kamchatka Philippines Time Asia/Manila Phoenix Is. Time Pacific/Enderbury Pierre & Miquelon Daylight Time America/Miquelon Pitcairn Standard Time Pacific/Pitcairn Pohnpei Time Pacific/Ponape Qyzylorda Time Asia/Qyzylorda Reunion Time Indian/Reunion Rothera Time Antarctica/Rothera Sakhalin Time Asia/Sakhalin Samara Time Europe/Samara Samoa Standard Time US/Samoa Seychelles Time Indian/Mahe Singapore Time Singapore Solomon Is. Time SST South Africa Standard Time Africa/Mbabane Table continues…

February 2019 Avaya Interaction Center CSPortal Web API SDK 37 Comments on this document? [email protected] API Documentation

South Georgia Standard Time Atlantic/South_Georgia Suriname Time America/Paramaribo Syowa Time Antarctica/Syowa Tahiti Time Pacific/Tahiti Tajikistan Time Asia/Dushanbe Timor-Leste Time Asia/Dili Tokelau Time Pacific/Fakaofo Tonga Time Pacific/Tongatapu Turkmenistan Time Asia/Ashkhabad Tuvalu Time Pacific/Funafuti Ulaanbaatar Time Asia/Ulan_Bator Uruguay Time America/Montevideo Uzbekistan Time Asia/Tashkent Vanuatu Time Pacific/Efate Venezuela Time America/Caracas Vladivostok Time Asia/Vladivostok Volgograd Time Europe/Volgograd Vostok Time Antarctica/Vostok Wake Time Pacific/Wake Wallis & Futuna Time Pacific/Wallis West Indonesia Time Asia/Pontianak West Samoa Time Pacific/Apia Western African Time Africa/Windhoek Western Argentine Summer Time America/Argentina/San_Luis Western European Summer Time WET Western European Time Africa/El_Aaiun Western Greenland Summer Time America/Godthab Western Standard Time (Australia) Australia/West Yakutsk Time Asia/Yakutsk Yekaterinburg Time Asia/Yekaterinburg

Survey API

Get /csportal/v1/getsurveyoptions Table continues…

February 2019 Avaya Interaction Center CSPortal Web API SDK 38 Comments on this document? [email protected] Survey API

Description: Provides survey options configured for the user logged-in. If the user is not logged in, this API provides a message that user is not logged in. For example, { "message" : "User is not logged in", "success" : false } If the user is logged, this API provides survey information in the “data” field as JSON data. For example, see the data in the following table: Response Content Type application/json { Sample data when user logged-in state (boolean): state, message (string): message, { data {} optional "message": "Successfully fetched survey } options", "data": { "survey.description": "Please take a moment to fill out this brief survey. It will help us provide the best possible service!", "survey.question.count": "3", "survey.question.2.text": "Did you receive fast response?", "survey.question.1.low": "Fair", "survey.title": "Customer Survey", "survey.question.3.text": "Did you receive useful information?", "survey.question.1.high": "Great", "survey.question.3.high": "Very Useful", "survey.canceldescription": "You have chosen to exit Chat without being helped by an agent. Help is also available by Email or Fax! Simply choose your support option on the toolbar to the left!", "survey.question.1.text": "Were agents courteous?", "survey.question.2.low": "Slow", "survey.canceltitle": "Chat Cancelled", "survey.question.3.low": "Useless", "survey.question.2.high": "Quick", "survey.canceltostartpage": "0", "survey.enabled": "1" }, "success": true }

POST /csportal/v1/submitsurvey Description: Provides ability to user to submit survey results for the logged-in user. If the user is not logged in, this API provides a message that user is not logged in. For example, { "message" : "User is not logged in", "success" : false } If the user is logged, this API provides ability to submit survey information as JSON data. For example, see the data in the following table: Response Content Type application/json { Sample data when user logged-in "eduid" (string): , "surveyvalues": { { "eduid": Table continues…

February 2019 Avaya Interaction Center CSPortal Web API SDK 39 Comments on this document? [email protected] API Documentation

"aicSurveyResponse1": "1" to "5", "544fd16f000000009493ae0a233e0002", "aicSurveyResponse2": "1" to "5", "surveyvalues": { "aicSurveyResponse3": "1" to "5" "aicSurveyResponse1": "5", } "aicSurveyResponse2": "2", } "aicSurveyResponse3": "4" } }

Estimated Wait Time (EWT) API

Get /csportal/v1/getewtenabled Description: Provides if Service class EWT is enabled on the website or not. If the user is not logged in, this API provides a message that user is not logged in. For example, { "message" : "User is not logged in", "success" : false } If the user is logged, this API provides ewtenabled information in the “data” field as JSON data. For example, see the data in the following table: Response Content Type application/json { Sample data when user logged-in state (boolean): state, message (string): message, data {} optional { } "message": "EWT State : ", "data": { "ewtenabled": "true" }, "success": true }

Get /csportal/v1/getserviceewt Description: Provides EWT of service class provided as parameter on the website. If the user is not logged in, this API provides a message that user is not logged in. For example, { "message" : "User is not logged in", "success" : false } If the user is logged, this API provides service class EWT information in the “data” field as JSON data. For example, see the data in the following table: Request Parameters Scname The serviceclass name. If not provided, SCEmail will be considered as the default name. Response Content Type application/json { Sample data when user logged-in state (boolean): state, message (string): message, { data {} optional "message": "EWT list : ", } "data": { "ewtused": "1", "qualifiers": "2.7", "state": "1", Table continues…

February 2019 Avaya Interaction Center CSPortal Web API SDK 40 Comments on this document? [email protected] CometD Chat API

"wat": "1164000", "oldest": "0", "ewt": "0", "scid": "23cb05d4a2e5bf28363909d92cd244e2" }, "success": true }

Get /csportal/v1/getallserviceewt Description: Provides EWT of all Service class on the website. If the user is not logged in, this API provides a message that user is not logged in. For example, { "message" : "User is not logged in", "success" : false } If the user is logged, this API provides all service class EWT information in the “data” field as JSON data. For example, see the data in the following table: Response Content Type application/json { Sample data when user logged-in state (boolean): state, message (string): message, { data {} optional "message": "EWT list : ", } "data": { "SCChat": { "ewtused": "1", "qualifiers": "2.7", "state": "1", "wat": "1164000", "oldest": "0", "ewt": "0", "scid": "23cb05d4a2e5bf28363909d92cd244e2" }, "SCEmail": { "ewtused": "1", "qualifiers": "2.5", "state": "1", "wat": "1200000", "oldest": "0", "ewt": "0", "scid": "8221435bcce913b5c2dc22eaf6cb6590" } }, "success": true }

CometD Chat API

POST /csportal/cometd/handshake Description: CometD handshake request to establish connection Request Parameters Response Content Type application/json;charset=UTF-8 Table continues…

February 2019 Avaya Interaction Center CSPortal Web API SDK 41 Comments on this document? [email protected] API Documentation

Request Param Body Data Model { "version":"1.0", "minimumVersion":"1.0", "channel":"/meta/handshake", "supportedConnectionTypes":["long-polling", "callback-polling"], "advice":{"timeout":60000,"interval":0}, "id":"2" } Response Content Type application/json { "id":"2", "minimumVersion":"1.0", "supportedConnectionTypes":["callback-polling","long-polling"], "successful":true, "channel":"/meta/handshake", "clientId":"yuyh3aetgd3snhspzxotntb4e", "version":"1.0" }

POST /csportal/cometd/ Description: CometD request to send commands to AIC chat server Request Parameters Response Content Type application/json;charset=UTF-8 Request Param Body Data Model Chat connection Open request {"channel":"/service/csportalchat","data": {"command":"open","time":"1427499550221","timezoneoffset":"-330"},"id":"3","clientId":" yuyh3aetgd3snhspzxotntb4e"} Chat Callinitiated request {"channel":"/service/csportalchat","data": {"command":"callinitiate"},"id":"7","clientId":"yuyh3aetgd3snhspzxotntb4e"} Send Typing Started request {"channel":"/service/csportalchat","data": {"command":"typing","callid":"5515ea1f000000009493ae0a235c0002","typingstate":"1"},"id" :"13","clientId":"yuyh3aetgd3snhspzxotntb4e"} Send Typing stopped request {"channel":"/service/csportalchat","data": {"command":"typing","callid":"5515ea1f000000009493ae0a235c0002","typingstate":"0"},"id" :"15","clientId":"yuyh3aetgd3snhspzxotntb4e"} Chat message send request {"channel":"/service/csportalchat","data": {"command":"chatsend","callid":"5515ea1f000000009493ae0a235c0002","message":"need help on mobiles"},"id":"19","clientId":"yuyh3aetgd3snhspzxotntb4e"} Sending Emoticons in chat message request {"channel":"/service/csportalchat","data": {"command":"chatsend","callid":"5515ea1f000000009493ae0a235c0002","message":"thanks for the help :)"},"id":"32","clientId":"yuyh3aetgd3snhspzxotntb4e"} Table continues…

February 2019 Avaya Interaction Center CSPortal Web API SDK 42 Comments on this document? [email protected] CometD Chat API

Sending URL in chat message request {"channel":"/service/csportalchat","data": {"command":"chatsend","callid":"5515ea1f000000009493ae0a235c0002","message":"http:// www.avaya.com"},"id":"46","clientId":"yuyh3aetgd3snhspzxotntb4e"} Sending Call Disconnect request {"channel":"/service/csportalchat","data": {"command":"calldisconnect","callid":"5515f508000000009493ae0a235c0002"},"id":"10","cli entId":"10ne3kzvnocyyo1cfbvvn3tjz4y"} Send Chat connection Close request {"channel":"/service/csportalchat","data": {"command":"close"},"id":"52","clientId":"yuyh3aetgd3snhspzxotntb4e"} Response Content Type application/json {"data":"{"chatmesg":{"userType":"caller","userName":"James Bond","message":"Need help on mobile devices ?","url":"","datetime":"1427499550775"},"event":"chatReceived","phrase":"","cal lid":null,"urlparams":""}","channel":"/service/csportalchat"}, {"id":"3","successful":true,"channel":"/service/csportalchat"}

POST /csportal/cometd/connect Description: CometD request to periodically poll and fetch the Chat Events from AIC Chat Server. Request Parameters Response Content Type application/json;charset=UTF-8 Response with no data {"id":"5","successful":true,"advice":{"interval":0,"reconnect":"retry","timeout": 30000},"channel":"/meta/connect"} Response with CallInitiated Event {"data":"{"chatmesg":{"userType":"system","userName":"System","message":"Initiating Call, Please Wait.","url":"","datetime":"1427499551352"},"event":"callInitiated","phrase":"","callid ":"5515ea1f000000009493ae0a235c0002","urlparams":""}","channel":"/service/ csportalchat"},{"id":"8","successful":true,"channel":"/meta/connect"} Response with PersonEntered Event {"data":"{"chatmesg":{"userType":"system","userName":"System","message":"Connecting... An agent will be with you shortly.","url":"","datetime":"1427499565953"},"event":"personEntered","phrase":"","cal lid":"5515ea1f000000009493ae0a235c0002","urlparams":""}","channel":"/service/ csportalchat"},{"id":"9","successful":true,"channel":"/meta/connect"} Response with chatReceived Event {"data":"{"chatmesg":{"userType":"system","userName":"System","message":"Welcome to Avaya Chat. You can chat and send pages.","url":"","datetime":"1427499565969"},"event":"chatReceived","phrase":"","callid ":"5515ea1f000000009493ae0a235c0002","urlparams":""}","channel":"/service/ csportalchat"},{"id":"10","successful":true,"channel":"/meta/connect"} Response with typingstatus Event {"data":"{"chatmesg": {"userType":"system","userName":"","message":"","url":"","datetime":""},"event":"typing status","phrase":"","callid":"5515ea1f000000009493ae0a235c0002","urlparams":"1"}","chan nel":"/service/csportalchat"},{"id":"12","successful":true,"channel":"/meta/connect"} Response with urlReceived Event Table continues…

February 2019 Avaya Interaction Center CSPortal Web API SDK 43 Comments on this document? [email protected] API Documentation

{"data":"{"chatmesg":{"userType":"agent","userName":"John","message":"","url":"http:// www.gsmarena.com","datetime":"1427499635826"},"event":"urlReceived","phrase":"","callid ":"5515ea1f000000009493ae0a235c0002","urlparams":"http:// www.gsmarena.com"}","channel":"/service/csportalchat"}, {"id":"24","successful":true,"channel":"/meta/connect"} Response with Emoticons {"data":"{"chatmesg":{"userType":"caller","userName":"James Bond","message":"thanks for the help ","url":"","datetime":"1427499652518"},"event":"chatReceived","phrase":"","cal lid":"5515ea1f000000009493ae0a235c0002","urlparams":""}","channel":"/service/ csportalchat"},{"id":"31","successful":true,"channel":"/meta/connect"} Response with callWrapped Event {"data":"{"chatmesg": {"userType":"system","userName":"","message":"","url":"","datetime":""},"event":"callWr apped","phrase":"","callid":"5515ea1f000000009493ae0a235c0002","urlparams":"http:// aicneo.apac.avaya.com/csportal/v1/showsurvey.jsp?htmlclient=true&chathandle=James +Bond&edu.pvchatenabled=false&edu.ivchatenabled=false&edu.tenantLogoURL=http%3a%2f %2faicneo.apac.avaya.com%2fcsportal%2fpublic%2fimages %2favaya.gif&customerEmail=customer1%40aicneo.apac.avaya.com&aicTenant=DefaultTenant&ai cLanguage=en&edu.tenant_key=1&tenant=DefaultTenant&customerInfo.state=loggedin&edu.call backtype=Immediate&customerInfo.displayName=James +Bond&languagecode=en&edu.language=en&customerInfo.tenant=DefaultTenant&DomainBaseURL=h ttp%3a%2f%2faicneo.apac.avaya.com%2fcsportal %2fv1&customerInfo.login=Guest&edu.requestedmedia=chat&customerInfo.is_deleted=0&edu.qu estion=Need+help+on+mobile+devices+ %3f&customerInfo.location=Other&edu.username=guest_Guest_69818723&email.from=support1%4 0aicneo.apac.avaya.com&edu.languagecode=en&edu.tenantName=DefaultTenant&language=en&edu .username_display=James +Bond&customerInfo.mangledName=guest_Guest_69818723&customerInfo.role=guest&customerInf [email protected]&eduID=087D0FD3CB55390319 274C68E6F31C18&callID=5515ea1f000000009493ae0a235c0002&aicSurveyHelped=true"}","channel ":"/service/csportalchat"},{"id":"50","successful":true,"channel":"/meta/connect"} Response with callDisconnected Event {"data":"{"chatmesg":{"userType":"system","userName":"System","message":"Call Disconnected.","url":"","datetime":"1427499677369"},"event":"callDisconnected","phrase" :"","callid":"5515ea1f000000009493ae0a235c0002","urlparams":""}","channel":"/service/ csportalchat"},{"id":"51","successful":true,"channel":"/meta/connect"} Response with chatRentered Event {"data":"{"callid":"5515f508000000009493ae0a235c0002","agentavailable":true,"event":"ca llReentered","chatmesglist":[{"userType":"caller","userName":"James Bond","message":"Need Help","url":"","datetime":"1427502343647"}, {"userType":"system","userName":"System","message":"Connection established.","url":"","datetime":"1427502343663"}, {"userType":"system","userName":"System","message":"Initiating Call, Please Wait.","url":"","datetime":"1427502344287"}, {"userType":"system","userName":"System","message":"Connecting... An agent will be with you shortly.","url":"","datetime":"1427502347797"}, {"userType":"system","userName":"System","message":"Welcome to Avaya Chat. You can chat and send pages.","url":"","datetime":"1427502347813"}, {"userType":"agent","userName":"John","message":"hello","url":"","datetime":"1427502350 262"},{"userType":"caller","userName":"James Bond","message":"need help on mobile","url":"","datetime":"1427502360418"}]}","channel":"/service/csportalchat"}, {"id":"5","successful":true,"advice":{"interval":0,"reconnect":"retry","timeout": 30000},"channel":"/meta/connect"}

POST /csportal/cometd/disconnect Table continues…

February 2019 Avaya Interaction Center CSPortal Web API SDK 44 Comments on this document? [email protected] JS SDK (WebAPI)

Description: CometD handshake request to establish connection Request Parameters Response Content Type application/json;charset=UTF-8 Request Param Body Data Model {"channel":"/meta/disconnect","id":"53","clientId":"yuyh3aetgd3snhspzxotntb4e"} Response Content Type application/json

JS SDK (WebAPI) The JS API layer simplifies writing new client and accelerates the development process. The layer provides JS API, Callbacks, and Events for quick integration with the UI. Using this API, the client can set the URL, which will serve as prefix while making the REST (AJAX) call to the server. If the URL being set is of different domain than the one in the browser URL, the developer must ensure the CORS support. The recommended way is to use we-redirection technique to avoid CORS restrictions put by all modern web browsers. AV.WebAPI.setServerURL(url); Set the server URL that is used to invoke REST APIs. AV.WebAPI.getServerURL(); Print the URL that the API uses. If you did not set the URL, the default URL is formed as follows: window.location.protocol + "//" + window.location.hostname + ":" + window.location.port AV.WebAPI.init(options[]); This is an initialization API and must be the first call after script loading is complete. Internally this API calls the REST API (http://148.147.174.7:9602/csportal /v1/getuser) and assigns values to various states depending on the response, such as what was the state, and escalation options. AV.WebAPI.login(options[]); This API takes certain parameters as user input as shown in the screen below. According to AIC design, the user must log in before calling escalation API for any of the channels. As a result of successful login response, the user gets the list of collaboration options which are enabled for Role and Selected Tenant. Here are few useful APIs which are used in app.js after login. AV.WebAPI.userLoggedIn(); //returns ‘true’ or ‘false’ AV.WebAPI.getUserInfo(); //returns userInfo Object. AV.WebAPI.getCollaborationOptions(); //various options Code References: app.js line #211 api.js line #343

February 2019 Avaya Interaction Center CSPortal Web API SDK 45 Comments on this document? [email protected] API Documentation

For information on Rules and Validations, see “REST API Documentation”. AV.WebAPI.logout (options[]); This API tries to logout customer session and on successful logout the Session Cookie is invalidated and UI is updated on client side. Code References: app.js line #60 api.js line #378 AV.WebAPI.getTenantList(options[]); This API gives you list of tenants available. app.js line #120 api.js line #254 AV.WebAPI.getLanguageList(options[]); This API gives you list of languages available for a tenant passed as input to the API. app.js line #147 api.js line #283

February 2019 Avaya Interaction Center CSPortal Web API SDK 46 Comments on this document? [email protected] JS SDK (WebAPI)

AV.WebAPI.getLocaleData(options[]); This API gives you JSON consisting of Name Value pairs of constants from AIC tenant data. The user can leverage JSON for localization or use for custom i18n/L10N implementation. app.js line #385 api.js line #312 AV.WebAPI.escalateEmail(options[]);

February 2019 Avaya Interaction Center CSPortal Web API SDK 47 Comments on this document? [email protected] API Documentation

For Validation and Rules, refer “Server REST API Section”. AV.WebAPI.escalateCallback(options[]);

For Validation and Rules, refer “REST API Documentation”.

February 2019 Avaya Interaction Center CSPortal Web API SDK 48 Comments on this document? [email protected] JS SDK (WebAPI)

AV.WebAPI.escalateLiveChat(options[]);

For Validation and Rules, refer “REST API Documentation”. AV.WebAPI.escalateJoinUS(options[]);

For Validation and Rules, refer “REST API Documentation”.

February 2019 Avaya Interaction Center CSPortal Web API SDK 49 Comments on this document? [email protected] API Documentation

AV.WebAPI.escalateLiveChatAndCallback(options[]);

For Validation and Rules, refer “REST API Documentation”. AV.WebAPI.showSaveChatTranscriptButton(bolean) You can use this API to enable and disable the Save button on the Chat user interface. Out-of- box, Avaya IC enables the Save button on the Chat user interface. Avaya IC provides the loader.js file with this API call for enabling and disabling the Save button. You can find the default loader.js file at /aic/sdk/js, where the System_Name is the name of system where you deployed the CSPortal client. Enabling the Save button To enable the Save button for the chat transcript from the chat user interface, you can call the AV.WebAPI.showSaveChatTranscriptButton(bolean) API with input parameter value to true. You must call the AV.WebAPI.showSaveChatTranscriptButton(bolean) API after calling the AV.WebAPI.init() API. To enable the Save button: 1. Call AV.WebAPI.init()

February 2019 Avaya Interaction Center CSPortal Web API SDK 50 Comments on this document? [email protected] JS SDK (WebAPI)

2. Call AV.WebAPI.showSaveChatTranscriptButton('true') Disabling the Save button To disable the Save button for the chat transcript from the chat user interface, you can call the AV.WebAPI.showSaveChatTranscriptButton(bolean) API with input parameter value to false. You must call the AV.WebAPI.showSaveChatTranscriptButton(bolean) API after calling the AV.WebAPI.init() API. To disable the Save button: 1. Call AV.WebAPI.init() 2. Call AV.WebAPI.showSaveChatTranscriptButton('false') AV.WebAPI.getsurveyoptions() You can use this API to fetch survey options configured on the website. Ensure user is logged in before calling this API. This API uses logged-in users tenant and language to fetch the survey options. AV.WebAPI.submitsurvey (options[]) You can use this API to submit survey results provided by the customer. Ensure user is logged in before calling this API. This API needs EDUID of the chat to record the survey result against. For Validation and Rules, refer “REST API Documentation”. AV.WebAPI.getEWTEnabled() You can use this API to check if EWT is enabled on the Website. Ensure user is logged in before calling this API. AV.WebAPI.getServiceEWT (options[]) You can use this API to fetch service class EWT. Ensure user is logged in before calling this API. For Validation and Rules, refer “REST API Documentation”. AV.WebAPI.getAllServiceEWT (options[]) You can use this API to fetch all service class EWT. Ensure user is logged in before calling this API. For Validation and Rules, refer “REST API Documentation”. JavaScript Chat API using CometD After success response from escalate chat API (i.e. AV.WebAPI.escalateLiveChat, AV.WebAPI.escalateLiveChatAndCallback, or AV.WebAPI.escalateJoinUS) proceed with CometD chat API to connect to server. Reference implementation of chat API is shown in aic_chat.js file. Register cometd listener $.cometd.addListener('/meta/handshake', _metaHandshake); $.cometd.addListener('/meta/connect', _metaConnect); Start Chat $.cometd.configure({ url : location.protocol + '//' + location.host + '/csportal/cometd', //logLevel : 'debug' }); $.cometd.handshake();

February 2019 Avaya Interaction Center CSPortal Web API SDK 51 Comments on this document? [email protected] API Documentation

Once connection is initialized $.cometd.batch(function() { _subscribe();}); Register for cometd chat message handler $.cometd.subscribe('/service/csportalchat', cometMsgReceived); Refer cometMsgReceived medhod for Event handling of chat message Send chat open request $.cometd.publish('/service/csportalchat', { command : 'open', time : msTime, timezoneoffset : timeZoneOffset }); Send Chat Initiate request $.cometd.publish('/service/csportalchat', { command : 'callinitiate' }); Send calljoin request $.cometd.publish('/service/csportalchat', { command : 'calljoin', callid : callID, callhandle : callHandle }); Send call disconnect after chat is complete from customer side $.cometd.publish('/service/csportalchat', { command : 'calldisconnect', callid : callID }); Send chat connection close request $.cometd.publish('/service/csportalchat', { command : 'close' }); Send typing started request $.cometd.publish('/service/csportalchat', { command : 'typing', callid : callID, typingstate : '1' }); Send typing stopped request $.cometd.publish('/service/csportalchat', { command : 'typing', callid : callID, typingstate : '0' });

February 2019 Avaya Interaction Center CSPortal Web API SDK 52 Comments on this document? [email protected] Customization options and examples

Customization options and examples

Embed WebSDK API In a sample client, the demo.html file serves as a demo page. However, this file will be the user’s website. For example, http://www.somebank.com. In the header section of the demo.html file, the loader.js file is included. The loader.js file enables the chat and SDK API by loading all scripts, CSS, resources needed. The SDK requires jQuery. Therefore, if the user page already loads one, loader.js will skip loading of jQuery again. Note: Note: For the Internet Explorer browser support, use the latest version of jQuery from 1.X. Otherwise, you can use jQuery 2.x.

Loading sequence The loader.js script loads all dependencies and initializes API. When the API is ready, every time the page loads, the API calls the REST API, getUser to check the state. When the request goes to the server, the session cookie (httpOnly, secure) is sent along with the request. The server extracts the cookie to lookup the state and responds with the JSON data which is used by the client to initialize or resume previous state based on the values sent by the server. Some key variables that the client looks for in the response are shown below: Is User Logged in? “success”: true "state":"loggedin"

Was Chat in progress? chatrentered: true

What all collaboration options are allowed for this user (‘Guest’ role)? "escmediaopts":{ "LiveChat":"true", "Email":"true", "Callback":"true", "ChatAndCallback":"true", } The flag in app.js allows various flows that the sample implementation can take.

February 2019 Avaya Interaction Center CSPortal Web API SDK 53 Comments on this document? [email protected] API Documentation

Auto login When the user opens the webpage, the auto-login feature allows the users of the website to automatically login as Guest thus avoiding user to type in the username. For example, if the property on Line #2 is set to false, loader.js would load the SDK and not login. //enable 'auto-login' var autoGuestLogin = 'true'; var closeChatOnLogout = 'true';

Proactive chat When the user opens the webpage, Proactive Chat feature allows guest user to automatically escalate chat with default question configured on the site. For example, if the property on Line #3 is set to true, loader.js would load the SDK and start chat when the page is loaded. When the chat is initiated it will pick the escalation question from the line #6. Ensure autoGuestLogin is set to true on Line #2 for this to work. var autoGuestLogin = 'true'; var autoProactiveChat = false; var reLogin = false; var closeChatOnLogout = 'true'; var defaultQuestion = 'May I help you';

Multi-tab support in chat Reference multi-tab support has been implemented in Chat using cometd multi-tab feature and browser localstorage api. The cometd multi-tab feature has extra polling overhead and depending on implementation the developer can choose to rely on browser session storage, local storage or cookies to completely bypass cometd multi-tab polling overhead.

February 2019 Avaya Interaction Center CSPortal Web API SDK 54 Comments on this document? [email protected] Chapter 7: Android Sample App

Set up your environment Before you start, be sure you have your development environment set up. You need to: • Download Android Studio. • Download the latest SDK tools and platforms using the SDK Manager.

Steps to Import Project in Android Studio Procedure 1. In Design and Admin Machine, extract AICCSPortalApp.zip from folder design \csportalmobile\android. 2. Open Android Studio. 3. Select “Import project (Eclipse ADT, Gradle, etc.)”. 4. Import AICCSPortalApp project.

Steps to Build Project in Android Studio Procedure 1. Open Android Studio. 2. Open AICCSPortal Sample App. 3. Select the Build menu, and then select the Generate Signed APK menu option. 4. Provide Signing information as requested. 5. Click Next. 6. Provide folder location to generate APK file. 7. Select Build Type as release. 8. Click Finish.

February 2019 Avaya Interaction Center CSPortal Web API SDK 55 Comments on this document? [email protected] Android Sample App

Steps to install sample app on Android device Before you begin Before installing the sample app in Android device, make sure that the Android Security settings are set as follows: • Enable installing app from unknown sources. • Disable Verify apps. After modifying the security settings, perform the following steps to install sample app. Procedure 1. Copy the CS Portal App binary(.apk) to Android device. 2. Install the apk with help of APK installer or any file explorer. 3. Click on the CS Port App icon. Note: Ensure that the security settings modified above are reverted after installation of the sample app.

Sample Code Walkthrough AICCSPortalApp project contains the following source structure: • csportalapi • model • service • ui • utils csportalapi package contains CSPortal REST API request and has implementation for following REST API request. • Login Request • Logout Request • GetUser Request • GetTenantList Request • GetLanguageList Request • GetLocalizedValues Request • GetTenantEscalateOpts Request • EscalateMedia Request

February 2019 Avaya Interaction Center CSPortal Web API SDK 56 Comments on this document? [email protected] Sample Code Walkthrough

model package contains JSON data model for REST API request and Chat Messages. The following are the JSON model used: • AICUser – denotes AICUser object used during login REST API request. • CallbackData - denotes CallbackData used during Callback and Chat and Callback REST API Request • EscalateMessage - denotes EscalateMessage used during EscalateMedia REST API request • ResponseMessage – denotes ResponseMessage object returned during the REST API request. • ChatUserData, ChatMessage, ChatMessageData, ChatMessageDataList - denotes the chat message data sent and received during the chat communication. service package contains the CSPortalChatService for Chat Communication and CSPortalService for servicing RESTAPI request. It also contains the CSPortalSession class which represents the chat session object and ChatEventHandler which is an callback interface of the messages received from the CSPortal Server when chat communication is active. ui package contains all the classes that builds the UI Look and Feel necessary to provide the user interface for the usage of the CSPortal sample app. • LoginActivity – Performs login activity. • UserSettingsActivity- Provides option to change user settings. For example, changing the CSPortal Server URL and email address for receiving email. • MainActivity – Provides the main screen for providing the following UI options: - HomeFragment – provides home screen with csportal escalation request in the grid format. - EmailFragment - provides email escalation request. - CallbackFragment - provides callback escalation request. - ChatFragment - provides chat escalation request. - ChatandCallbackFragment - provides chat and callback escalation request. - JoinusFragment - provides joinus escalation request. - PhoneFragment - provides option to make phone call using the callcenter number provided. - AboutFragment - provides info about the sample app. - ChatTrascriptFragment - provides chat transcript UI for the communication between the customer and the Agent. utils package contains all the constants and the utility functions referred in the sample app.

February 2019 Avaya Interaction Center CSPortal Web API SDK 57 Comments on this document? [email protected] Glossary

AIC Avaya Interaction Center

AJAX Asynchronous JavaScript and XML

CORS Cross-Origin Resource Sharing

CSPortal Customer Service Portal

CSS Cascading Style Sheet

DOM Document Object Model

DWR Direct Web Remoting

JSON JavaScript Object Notation

MVC Model View Controller

REST Representational State Transfer

XHR XMLHttpRequest

February 2019 Avaya Interaction Center CSPortal Web API SDK 58 Comments on this document? [email protected]