Configure your Bot for SDKs
Bot Configuration Guide using SDKs and Symphony Generator
This page is a language-agnostic bot configuration guide for building bots using Symphony SDKs and the Symphony Bot Generator.
For example purposes, we will be generating a Java chat bot. However, the configuration steps provided can be applied to our SDKs in other languages.
The Symphony Bot Generator is a Yeoman-based code generator that generates a project scaffold for the Symphony SDKs. The generator does the following for you:
  • RSA Key/Certificate creation
  • Bot configuration
  • Generate project structure
  • Build of example projects

Prerequisites

Install Yeoman and the Symphony Bot Generator:

1
$ npm install -g yo generator-symphony
Copied!

1. Generate Your Bot

To launch the Symphony Bot Generator:
1
$ yo symphony
Copied!
This will prompt you with a number of questions about your Symphony environment and bot metadata. Type in your bot's basic information metadata, and press enter to move onto the next prompt. If questions give you multiple options, use the keyboard arrows to scroll:
1
/------------------------------------------/
2
/ SYMPHONY GENERATOR 1.4.3 /
4
/ (c) 2020 Symphony Communication Services /
5
/------------------------------------------/
6
? What do you want to create bot
7
? What is the name of your project demoBot1
8
? What is your POD subdomain develop2
9
? What is your preferred programming language Java
10
? What is the BOT username demoBot1
11
? What is the BOT email address [email protected]
12
? What is your preferred encryption technology RSA - Generate New Keys
13
? Which template do you want to start with Request/Reply
14
* Generating bot Java code from Request/Reply template...
15
Looking for latest version of Java client library..
16
Latest version of Java client library is 1.3.0
17
generating from template Request/Reply
18
* Generating RSA public/private keys for BOT demoBot1...
19
* BOT generated successfully!!
20
create pom.xml
21
create src/main/java/IMListenerImpl.java
22
create src/main/java/RequestReplyBot.java
23
create src/main/java/RoomListenerImpl.java
24
create src/main/resources/config.json
25
create certificates/all_symphony_certs_truststore
Copied!
Note: In this guide, we will select 'RSA - Generate New Keys'. If you have pre-existing RSA keys or wish to use certificates, select the other options accordingly.
Upon completion, the Symphony Bot Generator has created a public/private RSA key pair, a configuration and requirements file, and also datafeed event listeners.

2. Configure your Bot

Once you have your generated bot scaffold, the next step is to configure your bot user:
Ensure that your pod admin has created a corresponding service account on the admin portal of your Symphony Pod. Additionally, you must upload the generated RSA public key for the service account created:
1
$ cd demoBot1
2
3
$ ls -l
4
certificates
5
pom.xml
6
rsa
7
src
8
9
$ cd rsa/rsa-public-demo-bot1.pem
10
-----BEGIN RSA PUBLIC KEY-----
11
MIICCgKCAgEAkuSmdAtnPDYF8j5lA9q5r7Mtv1uzbAr1RR6W+WqZKOkp5BdBmEz9C9h3qBfp
12
SdBpowYd7DbMwcMUZZ69nxOrtjqJiTxIG/dPswiN4/I275gaFarUMkHGFqEDKMjR0gNG0oj8
13
dYubtHcg3w06mYrRpj1wJLWm7Vg5+/QH2cDK0qP2kGLcozHf+MMg7f0c8dBx3esdRxs3Rcwf
14
LrjKH0mgTC6W1l/VFu6P/+2LV/1toDg+LNtBVZH5eMimvFCH9nAd7Vge2GgHGD8HGA7mnlPk
15
lEovSjKCsQDxafuBL0NH2PMW7l9/kBrWj8Wh2QNwNOnTUm67euD09MR4T/1amF23f0BWjjoW
16
OtosWcKXh5Rye6syKY68Rj9ShzPOYC0z0FASBEfFeb4YQ7GbG0UhS4ya+HO/URCwkOkWVq2r
17
yb8SRPAliZn/sUYNtcDMO3CKzC0RveJsYrmHg2Hswr1333cQkqXbGI+q1ZDIw2HWENQGt/NT
18
qhDVL8boocTSnMSajdRLFnn1aPwp1tvSBrng01u6nqlfDxHXlVuiNWTQ8/mf41ea1X2/CGtM
19
Agl9PvxdKEkNXJVPdUtBm7jIqQlljheYDs0825YP59H5WmaG3jywrkAS6QDP7uYvYd4skeJH
20
/QBDo29BBEWeigHJurdgbFGJK9+jUt9pcvxB31GlHS3gb1MCAwEAAQ==
21
-----END RSA PUBLIC KEY-----
Copied!
Copy the entire contents of this RSA public key including the dashes on either side, and hand it to your pod admin and request for it to be saved against the respective service account you will be using.
Note: The bot username entered into the Bot Generator must match exactly the username on the service account as shown above
For a detailed guide on how to create a service account in the admin portal, check out this guide:
Open your generated bot code in your favorite IDE and navigate to the config.json file:
config.json
1
{
2
"sessionAuthHost": "develop2.symphony.com",
3
"sessionAuthPort": 443,
4
"keyAuthHost": "develop2.symphony.com",
5
"keyAuthPort": 443,
6
"podHost": "develop2.symphony.com",
7
"podPort": 443,
8
"agentHost": "develop2.symphony.com",
9
"agentPort": 443,
10
11
"truststorePath": "certificates/all_symphony_certs_truststore",
12
"truststorePassword": "changeit",
13
14
"botUsername": "demoBot1",
15
"botEmailAddress": "[email protected]",
16
17
"botPrivateKeyPath": "rsa/",
18
"botPrivateKeyName": "rsa-private-demoBot1.pem",
19
20
"botCertPath": "",
21
"botCertName": "",
22
"botCertPassword": "",
23
24
"proxyURL": "",
25
"proxyUsername": "",
26
"proxyPassword": "",
27
"keyManagerProxyURL": "",
28
"keyManagerProxyUsername": "",
29
"keyManagerProxyPassword": ""
30
}
Copied!
Confirm that the sessionAuthHost, keyAuthHost, and agentHost matches the correct Pod, Key Manager, and Agent endpoints respectfully. Additionally, confirm that the botUsername, and botEmailAddress match the information entered in the admin portal on the Pod.
The config.json file has other fields that offers advanced configurations for proxy servers, certificate truststores, and custom ports. If these don't apply to your Bot or environment, leave them blank.

3. Build Your Bot

Now that you have generated and configured your Bot, move on to one of the SDK bot tutorials: