You can integrate Freshbots with Freshchat to serve bot as an external service which is called Freshchat BYOB(Bring Your Own Bot). Freshchat is a live chat product that helps in easy messaging with customers.


Freshbots-Freshchat integration helps in the scenario where a user engaging with the bot wants to talk to a live chat agent, then the conversation will be handed over to a Freshchat agent. The bot will kick in again once the ticket is resolved.


Steps to integrate Freshbots with Freshchat


* Create a Fresh chat account by following this link, if you don’t have one already.


In the Bot builder:

* Click on the Bot Settings icon.

* Choose Freshchat option under 'Channels & Integrations' and click on +New Integration. 



* You can either create your own bot and sync it or you can use the Freshchat widget.

* In the configuration page, fill the following fields :




BYOB App Id - fill this with FRESHCHAT APP_ID

BYOB API Key - fill this with FRESHCHAT API_KEY

BYOB bot user ID - fill this with FRESHCHAT BOT_USER_ID

BYOB assigned group- this will be the template that will get from flow to assign the conversation dynamically to the Freshchat group.

BYOB Customer Meta - fill this with the following payload:

[{

"name": "propertyName",

"value": "propertyValue"

}, {

"name": "propertyName",

"value": "propertyValue"

}, {

"name": "propertyName",

"value": "propertyValue"

}]


Here, you can fill with template variables or with static values and that will be used to update the user properties.

 In the Freshchat page:

* In the Freshchat page disable the bots and enable the webhooks from settings.

* In the webhook settings, give the endpoints in URL format based on your region and save the webhook settings.

 

 


Embed the Freshchat SDK on the page:

* In the Freshchat page, Click on Settings and choose the Web Messenger.



* From the widget code, copy both the Head & Body code and paste it on your website.





For a manual test, run follow the procedure:

Test your changes as an end-user by pasting your copied code snippet in https://jsfiddle.net/