Enable a tenant for Digital Channels

From Genesys Documentation
Jump to: navigation, search
This topic is part of the manual Digital Channels Private Edition Guide for version Current of Digital Channels.

Learn how to enable your tenant for Digital Channels.

Important
“Nexus” is the simplified name we use for the Digital Channels application and nodes, so you’ll see that name referenced throughout this document.
Complete the steps on this page to provision your tenant and set up Digital Channels to work with Web Services and Applications (GWS).

Prerequisites

Review the Prerequisites table and make sure you have all the listed information before you get started. The values in this table are referenced later by the name in the Variable column.

Prerequisites
Parameter Variable Type Example Notes
GWS URL $gwsURL HTTPS URL string https://gws.mydomain.com Host of the Web Services and Applications load balancer.
Auth URL $authURL HTTPS URL string https://auth.mydomain.com Host of the Auth Services load balancer.
GWS admin username $gwsAdminName string ops The GWS ops credentials. See Provision Genesys Web Services and Applications.
GWS admin password $gwsAdminPass string ops The GWS ops credentials. See Provision Genesys Web Services and Applications.
Tenant User $tenantUser string nexus The Person username from your tenant configuration. See Create a Person object.
Tenant User Password $tenantUserPassword string nexus_password The Person password from your tenant configuration. See Create a Person object.
Contact Center ID $ccId string 578ec98e-f07c-46ad-9675-f36c22f3ba9f The contact center ID provisioned in Web Services and Applications. If you don't have this ID, see Get contact center ID from GWS below.
Tenant Name $tenantName string premise_tenant The tenant name you used as <$tenantName/$ccId> in the Enable Nexus UX step.
Digital Channels FQDN URL $nexusURL HTTPS URL string https://nexus.mydomain.com The fully qualified domain name (FQDN) for Digital Channels.
UCS URL $ucsURL HTTPS URL string https://ucs.mydomain.com A URL pointing on the Universal Contact Service (UCS) entry point.
Important
Use a REST client or curl utility to make the requests explained on this page. Make sure to substitute the variables - prefixed with '$' - with their values.

Get contact center ID from GWS

If you don't have the contact center ID (as specified in the Prerequisites table above), you can get it with the following request:
curl --user $gwsAdminName:$gwsAdminPass --request GET '$authURL/environment/v3/contact-centers'
The expected response:
{
    "data": {
        "contactCenters": [
            {
                "id": "<your contact center id ($ccId)>",
                "environmentId": "<your environment id>",
                "domains": [
                    <list of domains for your contact center>
                ],
                "auth": "configServer"
            }
        ]
    }
}

Add GWS to the list of available GWS services for Nexus

Complete the steps in this section to add GWS to the list of available GWS services for Nexus.

Create the authentication client

To create the authentication client, send a POST request to GWS that includes a body parameter called data in JSON format. Give data the following properties:

Property Value
clientType CONFIDENTIAL
internalClient true
authorizedGrantTypes refresh_token, password, client_credentials, authorization_code
redirectURIs $nexusURL
authorities ROLE_INTERNAL_CLIENT
scope *
description nexus_client
name nexus_client
client_id nexus_client
client_secret <client secret token> - randomly generated and saved for further use
accessTokenExpirationTimeout 43200
refreshTokenExpirationTimeout 2592000

Sample request

curl --user $gwsAdminName:$gwsAdminPass --request POST '$authURL/auth/v3/ops/clients' \
--header 'Content-Type: application/json' \
--data '{"data": {
    "internalClient": true,
    "name": "nexus_client",
    "clientType": "CONFIDENTIAL",
    "client_id": "nexus_client",
    "client_secret": "<client secret token>",
    "authorities": ["ROLE_INTERNAL_CLIENT"],
    "scope": ["*"],
    "authorizedGrantTypes": ["client_credentials", "authorization_code", "refresh_token", "implicit", "password"],
    "redirectURIs": ["$nexusURL"],
    "accessTokenExpirationTimeout": 43200,
    "refreshTokenExpirationTimeout": 2592000
    }
}'

Expected response

The expected response is 200 OK.

Verify client

To verify that authentication was successful, send a POST request to GWS:

curl --user nexus_client:<client secret token> \
--request POST '$authURL/auth/v3/oauth/token?grant_type=client_credentials&scope=*&client_id=nexus_client&client_secret=<client secret token>'
This is the response:
{"access_token":"<bearer token>","token_type":"bearer","expires_in":43199,"scope":"*"}

Add GWS to the nex_gapis table for Nexus

Execute the following query in the PostgreSQL command line interface:

INSERT INTO nex_gapis (url, clientid, apikey, clientsecret, created, region, authinturl, authexturl) VALUES ('$gwsURL', 'nexus_client', 'NA', '<client secret token>', now(), NULL, '$authURL', '$authURL');

Provision Digital Channels in GWS

To provision Digital Channels in GWS, send a POST request to GWS:
curl --user $gwsAdminName:$gwsAdminPass --request POST '$authURL/environment/v3/contact-centers/$ccId/settings' \
--header 'Content-Type: application/json' \
--data '{
    "data":
    {
        "name":"chatservice-uri",
        "location":"/",
        "value":"$nexusURL",
        "shared":false
    }
 }

Get the authentication token

To get the authentication token, send a POST request to GWS:
curl --user nexus_client:<client secret token> --request POST '$authURL/auth/v3/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'username=$ccId\\$tenantUser' \
--data-urlencode 'client_id=nexus_client' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'password=$tenantUserPassword'
The expected response:
{"access_token":"<$outGWSAccessToken>","token_type":"bearer","refresh_token":"<refresh_token>","expires_in":43199,"scope":"*"}

As an output of this step, you will have the GWS access token:

Parameter Variable Type Example Notes
Nexus API Key $outGWSAccessToken UUID string 9b7682b7-cbce-422f-9bbb-ecda85e61695 The access_token from the response example.

Provision the Universal Contact Service connection

You must complete this step if you are using Universal Contact Service in your environment.

Make the following POST request to create the PlatformUCS service:

curl -X POST \
  $nexusURL/nexus/v3/provisioning/services/$ccid/PlatformUCS \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: $apiKey' \
  -H 'x-ccid: $ccid' \
  -d '{
    "url" : "$ucsURL",
    "secret": {},
    "data" : {}
}'

Provision the tenant in Digital Channels

To provision the tenant in Digital Channels, make the following POST request:
curl --request POST '$nexusURL/nexus/v3/provisioning/tenants' \
--header 'Authorization: Bearer $outGWSAccessToken' \
--header 'Content-Type: application/json' \
--data '{
  "id": "$ccId",
  "name": "$tenantName",
  "type": "PureEngage",
  "backendurl": "$gwsURL",
  "username": "$tenantUser",
  "token": "$tenantUserPassword",
  "genesystenantid": 1
}'

The expected response:

{
    "status": {
        "code": 0
    },
    "data": {
        "xapikey": "$nexusApiKey"
    },
    "operationId": "ec90f3d2-f4b5-47fd-9004-2c309398ab38"
}
As an output of this step, you will have the specific tenant API key:
Parameter Variable Type Example Notes
Nexus API Key $nexusApiKey UUID string 9b7682b7-cbce-422f-9bbb-ecda85e61695 The xapikey from the response example. For creating chat.

Enable routing using Designer Applications

Use Agent Setup to add the following values to the "DesignerEnv" transaction in the Environment tenant. If the transaction doesn't exist, create it with a type of List and "DesignerEnv" as Name and Alias.

Property Value
baseurl <Nexus FQDN URL>/nexus/v1
password <consumer api-key>
url <Nexus FQDN url>/nexus/v3