Type: Freshchat Worker
A Freshchat worker will route a conversation to a live agent in Freshchat. A Freshchat worker can be created through the CLI.
Note: Freshchat workers cannot be interacted with directly by users, they must be transferred to via another worker first, for example a flow worker using pushBotToStack.
A Secret (of type secret) containing a Freshchat API key is required in order to access Freshchat. Please see secrets for more information on creating a secret.
The value of the secret can be found in the admin portal of Freshchat, on the API Key page. You can create one if one does not already exist.
You must enable and configure Freshchat with a webhook to Hookit2Me prior to being able to use the worker. In the Freshchat admin portal, navigate to webhook settings. Enable the webhook if it is not already, and set it to the public hookit2me url for the region you worker will be in. Note the RSA key down for later use.
Below is an example of a Freshchat worker in json, ready to be created with the CLI.
{
"Data": {
"Url": "https://api.eu.freshchat.com",
"AuthKeySecret": "srn:vault::my-org:secret:freshchatkey",
"AppId": "12345678-1234-1234-1234-123456789012",
"ChannelId": "12345678-1234-1234-1234-123456789012",
"PublicKey": "-----BEGIN RSA PUBLIC KEY-----someRSAkey-----END RSA PUBLIC KEY-----",
"Events": {
"OnDisconnection": [
{
"type": "content",
"value": "FreshChatDisconnection"
}
],
"OnResolution": [
{
"type": "markup",
"value": "<TimelineMessage minimumDisplayTime='1.5'><TextMsg>OnEventMarkup - Conversation has been resolved, disconnecting from live chat.</TextMsg></TimelineMessage>"
}
],
"OnError": [
{
"type": "message",
"value": "OnEventMessage - Something has gone wrong with your freshchat conversation"
}
],
"OnTransfer": [
{
"type": "content",
"value": "FreshChatTransfer"
}
],
"OnTransferFailure": [
{
"type": "content",
"value": "FreshChatTransferFailure"
}
]
},
},
"Organization": "my-org",
"Config": {},
"Enabled": true,
"Description": "My Freshchat worker",
"Type": "freshchat-worker",
"Name": "myFreshWorker",
}
Within the Data object, there are several Freshchat-specific fields that need to be filled out.
To end a conversation with a user from the Freshchat agent side, resolving the conversation will remove the user from it and let them know it was resolved.
Users can also end the conversation by typing /leave
, which will result in the conversation resolving in the Freshchat interface as well.
Events are ways to customize the hardcoded messages inside the worker. If any the below are missing from the Events
object they will use the default ones. If you don’t want any message not show then you can place an empty array []
Below are a list of each event and when its triggered
Any botnet action is support here. If any onEvent is not set then a default will be sent out