Install Chat Session REST API

Prerequisites

Note

Only available for Skype for Business and Microsoft Teams clients.

Introduction

The REST API allows external software to communicate with the Chat Session API in the PluginFramework. It is possible to start a chat session inside the UCC and hunt an agent in a specific skill. An example scenario is as follows:

  • A bot doesn't know how to handle a user's question and wants to connect the user with a human agent.

  • Bot creates a chat session via REST API

  • Bot sets skill for the session

  • The UCC will hunt an agent and notify the bot when the connection with an agent is established.

  • Bot proxies the messages between user and agent

  • Bot or agent decides to stop the call

Configuration

Deploy plugin

  1. Log in on the server on which the UCC service is running.

  2. Go to the plug ins folder (‘DRIVE:\program files\anywhere365\plugins\'). If it doesn't exist, create it.

  3. Create a folder "RestApi" for the plugins folder.

  4. Copy the dlls and included config files from the plug in package to this folder.

  5. Open file ‘Config.xml’ for editing purposes.

    Tip

    First make a backup of the file to prevent problems!

    The default path of this file is:

    C:\ProgramData\Anywhere365\Core\Service\UnifiedContactCenterService\Config.xml

  6. Add "Plugin" value below ‘SettingsURL’ of the UCC.

    XML
    <Plugin name="ChatSession" isIdentityPlugin="false" path="C:\Program Files\Anywhere365\Plugins\RestApi" file="Wsp.Anywhere365.Ucc.PluginFramework.Rest.Plugin.dll"/>

Configure PluginSettings

There are some settings which can be configured through the sharepoint list PluginSettings:

Setting Scope Value Default value Description
HttpPort

RestApi

int

80

The HTTP port to listen on. You can use same portnumber for multiple UCCs, but different ports can be used. When the port isn't available an error is written in the UCC logs. It's unlikely the default port is available because the Microsoft IIS Server is most likely using it.

AuthorizationToken

RestApi

string

empty

This is a password you can set to secure the REST API. When this setting is not added, the API can be used by anyone. The token must be passed in the HTTP Authorization request header

The REST endpoint will be available on /ucc-name on the configured port.

Secure connections

The plugin does not support the configuration of TLS certificates, however you are free to use a reverse proxy/loadbalancer in your network to secure the connection to the outside world.

Proxy connections

If the url (provided during the creation of a new chat session) requires a public internet connection, but the server is configured to use a proxy to connect to the internet. Proxy settings should be added to the UCC config.

  • Navigate to the UCC installation directory

  • Edit the wsp.anywhere365.ucc.service.exe.config

    C:\Program Files\Anywhere365\Core\UCC\

  • Right below <configuration> add the proxy configuration

  • For more information about proxy config: https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/network/defaultproxy-element-network-settings

  • Example proxy configurations:

    • Proxy Address + Port

      XML
      <system.net>
      <defaultProxy enabled="true">
      <proxy bypassonlocal="True" proxyaddress="http://proxy.domain.org:8888/" />
      </defaultProxy>
      </system.net>
    • Proxy Automatic Configuration script

      XML
      <system.net>
      <defaultProxy useDefaultCredentials="false">
      <proxy usesystemdefault="False" scriptLocation="http://pac.domain.com/global.pac" />
      </defaultProxy>
      </system.net>