Integrating with Genesys Bot Connector
IBM Cloud
Use the Genesys Bot Connector integration to connect your assistant with Genesys.
The Genesys Bot Connector enables Genesys Architect Flow designers to integrate their messaging and conversation flows with any third-party virtual assistant.
Before you begin
You must comply with the folowing requirements before you start integrating your assistant with Genesys Bot Connector:
- A new account or log in to an existing Genesys Cloud account with access to Genesys Architect and the correct region at the Genesys Cloud portal.
- The
Admin
role in the Genesys Cloud organization. For more information on Genesys Cloud roles and permissions see, Roles and permissions overview.
Set up Bot Connector in Genesys
-
Go to the Genesys Admin page.
-
Under Integrations, click Integrations.
-
On the Integrations page, click +Integrations.
-
Search for Genesys Bot Connector, and click Install.
-
In the Details tab, enter a name and any notes for your Bot Connector.
-
Click Copy the Integration ID, and save. You need the Integration ID to create the watsonx Assistant Genesys Bot Connector integration.
-
In the Configuration tab, under Properties, enter a placeholder Bot Connector Handle Utterance URI. You need to come back and update this URI after a watsonx Assistant Genesys Bot Connector integration is created.
-
In the Credentials tab, use Configure to create a credential field with Field Name as x-watson-genesys-verification-token and with Value as the secret you set in watsonx Assistant. You need this value to create the watsonx Assistant Genesys Bot Connector integration. Copy and keep the token and value, so you can paste them into the Verification Token field when you integrate with watsonx Assistant.
You cannot see these credentials again after clicking Save.
-
Click OK and Save.
Keep the Genesys web page open in a web browser tab so you can refer to and complete fields as setup progresses.
Integrate watsonx Assistant with Genesys
Create the Bot Connector integration
-
Go to the watsonx Assistant Integrations page by clicking the integrations icon () in the left menu.
-
Click Add on the Genesys Bot Connector tile.
-
Click Confirm.
Connect watsonx Assistant to Genesys
-
From the Genesys site, you need your Genesys OAuth credentials.
OAuth credentials are on the Genesys Admin page under Integrations > OAuth. You need credentials with Grant Type Client Credentials and a role that has BotConnector permissions.
Copy and keep the following values, so you can paste them into the Genesys Bot Connector integration setup page.
- Client ID
- Client Secret
-
Return to the watsonx Assistant Genesys Bot Connector integration setup page, and then click Next.
-
Enter the required fields, and then click Next.
- Client ID
- Client Secret
- Verification Token (token and value from Genesys Bot Connector setup)
- Integration ID
- API URI (the Genesys API server for your region e.g.,
https://api.regionxyz.mypurecloud.com
)
For security reasons, the authentication fields are removed from view after initial setup.
Configure your Genesys Bot Connector
-
Copy the value generated in the Webhook URI field.
-
Go to the Genesys Bot Connector Configuration tab you left open. Under Properties, replace the placeholder Bot Connector Handle Utterance URI you entered previously with this Webhook URI value.
-
Click Finish.
If a field required for authentication is changed, then all entries in related fields must be filled and validated again.
Chat with the assistant
To start a chat with the assistant, complete the following steps:
- Open Genesys Architect, and create an Inbound Message Flow.
- In the Toolbox, click Bot, and then Call Bot Connector.
- Select the values:
- Bot Integration:
- Bot Name: IBM watsonx Assistant Bot Connector
- Bot Version: 1.0
- Bot Integration:
- Enter session variables you want to be passed to and from watsonx Assistant. For more information, see Context Sharing through Session Variables.
- Output of the Bot Connector is
Success
orFailure
. You should branch your Genesys flow upon exit from the Bot Connector according to the output Intent of the Bot Connector. For more information, see Conditioning and Output Branching.
Context-sharing through session variables
From the Bot Connector node in the Genesys Architect flow, you can specify session variables that can be used to pass information to watsonx Assistant. You can specify both Input and Output parameters. For the integration, both of these parameters
are merged into a single object under the context
object.
Both Input and Output parameters are available in the watsonx Assistant context
, and the information is shared on each turn. For example, the context
made available in watsonx Assistant is:
{
"context": {
"integrations": {
"genesys_bot_connector": {
"user_id": "<SENT FROM GENESYS>",
"some_variable": "<SET_FROM_WATSON_ASSISTANT>"
}
}
}
}
For Input parameters, you can access the session variable in watsonx Assistant with $integrations.genesys_bot_connector.user_id
.
For Output parameters, you can assign the session variables to a state variable in Genesys (e.g., State.some_variable
and access them later on in your flow).
Variables can be read and set from both Dialog and Action skills.
Set slot parameters by the watsonx Assistant Bot Connector
watsonx Assistant Bot Connector sets the following output parameter based on the last conversation turn when the conversation ends.
Parameter | Description |
---|---|
Intent |
watsonx Assistant is set to the recognized intent by Dialog skill as the slot value for the Success intent. |
Conditioning and output branching
From Genesys Architect, you can use Logical
functions to branch out your flow based on the context shared back from watsonx Assistant. For example, watsonx Assistant returns an Intent
parameter that is saved to State.Intent
.
In architect, you can add a Switch
action to branch out to different scenarios. For example, you can configure a case where State.Intent == "connect_to_agent"
, and then branch out.
Ending the Genesys Bot Connector flow
When the conversation reaches the Bot Connector node in Architect, Genesys proxies messages between the user and watsonx Assistant, and continues until the conversation ends. To pass the conversation back to Genesys, you need to use the connect_to_agent
response type or the end_session
response type.
{
"output": {
"generic": [
{
"response_type": "text",
"values": [
{
"text": "You have ended the call."
}
]
},
{
"response_type": "end_session"
}
]
}
}
{
"output": {
"generic": [
{
"response_type": "text",
"values": [
{
"text": "Connecting you to an agent."
}
]
},
{
"response_type": "connect_to_agent"
}
]
}
}
User-defined response type
The user_defined
response type allows you to pass a custom response back to Genesys. For example, this can be used to pass Cards
and Carousels
back to Genesys which do not have a watsonx Assistant equivalent
response type. An example of sending back a Card
back to Genesys is:
{
"output": {
"generic": [
{
"user_defined": {
"replyMessages": [
{
"type": "Structured",
"content": [
{
"contentType": "Card",
"card": {
"title": "Card title",
"description": "Card description",
"image": "http://www.samplesite.com/photo/1234.jpg",
"actions": [
{
"type": "Link",
"text": "Link display text",
"url": "http://www.samplesite.com"
},
{
"type": "Postback",
"text": "Postback display text",
"payload": "Postback text"
}
]
}
}
]
}
]
},
"response_type": "user_defined"
}
]
}
}
Response types
These response types are supported and displayed as expected when your assistant is deployed for the Genesys Bot Connector channel.
- connect_to_agent
- end_session
- option
- text
- user_defined