All articles on Sunshine Conversations
This guide describes how to enable live agent chat conversations with Cognigy.AI and Sunshine Conversations in Zendesk.
1 Setup Sunshine Conversations
In order to use Zendesk within a Cognigy conversation, the following steps need do be done:
- Create a Sunshine Conversations App
Afterward, all necessary connectors, in this case, integrations, have to be included:
- Add a Zendesk Integration
- Add a Web Messenger Integration
- Add a Webhook Integration
After adding those to the app, the integration overview should look like this:
Figure 1.1: Sunshine Conversations Integrations
Provide the Webhook for Cognigy
All Cognigy.AI messages from the bot will be forwarded to Sunshine Conversations by using the Webhook integration. Therefore, the following HTTP request (API V2) needs to be executed to add a new integration to the app:
COGNIGY-CONFIG-URL:
This needs to be filled with the Endpoint URL
that will be provided by the Cognigy.AI project at a later stage.
SUNSHINE-KEY-SECRET:
Insert your Sunshine Conversations API Key Secret
.
Add Switchboard Integrations
In general, the agent handover will execute a so-called pass control function to forward the current bot conversation to Zendesk and vice versa. In order to provide this mutual alternation of responsibility, two switchboard integrations are required:
{
"switchboardIntegrations": [
{
"name": "ZD",
"integrationId": "5f368c78fdabdd88c18c8820",
"integrationType": "zd:agentWorkspace",
"deliverStandbyEvents": false,
"nextSwitchboardIntegrationId": "5f36d83ef02582000c064cbb",
"messageHistoryCount": 10,
"id": "5f36b165fd9598000ce0356b"
},
{
"name": "bot",
"integrationId": "5f36d80a0e7100000d2b5c42",
"integrationType": "custom",
"deliverStandbyEvents": false,
"nextSwitchboardIntegrationId": "5f36b165fd9598000ce0356b",
"id": "5f36d83ef02582000c064cbb"
}
]
}
ZD:
This switchboard integration represents the Zendesk support agent workspace where a human can talk to the user which was talking to the bot before.
bot:
This integration represents the Cognigy.AI bot that first talks to the user and later if asked for, forwards the conversation to the Zendesk workspace (passes control).
- It is very important, that the bot integration is marked as
defaultSwitchboardIntegrationId
in the configuration!- PATCH https://app.smooch.io/v2/apps/:appId/switchboards/:switchboard/
- Body: {
"defaultSwitchboardIntegrationId": bot-switchboardIntegration-ID
}
2 Setup Cognigy.AI
Now one needs to create a Cognigy.AI project (Virtual Agent) to provide the conversational interface:
- Login to Cognigy.AI
- Create a new Virtual Agent
- Add the Sunshine Conversations Endpoint in the Setup
- In the left menu, go to
Manage -> Extensions
and upload the Sunshine Conversations Extension (Tar File) - Go to
Build -> Flows -> Main
and click on the + button in the Flow chart.- Search for Pass Control.
- Click on it to add the node to the Flow chart.
- Click on the node to view the details.
- You will now see that there is a Connection field that needs to be configured.
- Use the Sunshine Conversations App information to set it up.
- The Flow is now ready to forward a conversation to the Zendesk workspace! In this case, the Flow Chart could look such as:
- For instance, a Lookup Node can check the intent/text of the user in order to handle handover requests. If the user's intent is the mentioned handover, a confirmation Say Node can be used for notifying the person.
- Furthermore, the Pass Control Node of the recently uploaded Sunshine Conversations Extension is used for passing the control of the conversation to the Zendesk Chat Agent.
- As soon as the Zendesk system took over the conversation, Cognigy.AI gets the following information inside of the Input object:
-
input.data.request.type === 'switchboard:passControl'
-
- In this case, the name of the created Switchboard Integration can be used in order to notify the chat user of the successful handover event. In this case, the Lookup Node, on the bottom left, checks the following in the CognigyScript type field:
-
input.data.request.payload.conversation.activeSwitchboardIntegration.name
-
- In this example, the Case uses the value "ZD", the name of the Switchboard Integration. This value could be different in another setup!
- Again, in the left menu, go to
Deploy -> Endpoints -> Sunshine Conversations
- Click on the Endpoint Url to copy it and paste it to your open API request to create a webhook in Sunshine Conversations -- see above.
- Scroll down and open the
Sunshine Conversations setup
section.- Fill in the app information, as you did in the Extension before.
- Use this URI: https://app.smooch.io
Test with the Web Messenger
Since the Sunshine Conversations app contains a Web Messenger integration, one can use this to chat with the AI on the web:
Figure 1.1: Sunshine Conversations Web Messenger
Comments
0 comments