Skip to content

Freshchat

The Freshchat integration lets the bot hand a conversation to your agents in Freshchat. The agents see the conversation and answer from Freshchat, and the answer reaches the customer in the channel they started in.

  • Amio support connects Freshchat to one of your bot’s channels. You cannot create this integration yourself in the admin. Write to support@amio.io and send the details listed below.
  • When the bot reaches Call Operator, Amio creates a conversation in Freshchat. It starts with the history of the chat so far, so your agent sees what the customer already asked.
  • While the conversation is handed over, the customer’s text and images go to the Freshchat agent. The agent’s text, images and files go back to the customer.
  • When the agent resolves the conversation in Freshchat, the bot’s Chat Ended event runs. Use it, for example, to ask for feedback. See How the bot works.
  • Button and quick reply clicks (postbacks) are not forwarded to Freshchat.

You need a Freshchat account on a paid plan with at least two users.

The screenshots show an older version of Freshchat, so the menus may look different.

Collect these four values in Freshchat and send them to support with the name of the Amio channel to connect.

  1. API key. In Freshchat, open Settings, then Admin Settings. Search for API Settings and copy the API key.

    Freshchat settings menu with Admin Settings

    Freshchat settings search for “api” showing API Settings

    Freshchat API Settings with Your API Key and Your chat URL

  2. API URL. On the same page, copy the chat URL, for example https://yourcompany.freshchat.com/v2.

  3. App ID. Search for Web Chat Settings, open Integration Settings and copy the App ID.

    Freshchat settings search showing Web Chat Settings

    Freshchat Account Settings with Integration Settings

    Freshchat Integration Settings with the App ID

  4. Channel ID. The Freshchat channel where the handed-over conversations should appear. To find it, call GET https://<your Freshchat domain>/v2/channels?items_per_page=50 with your API key as a bearer token, and copy the id of the channel you want.

Support may also ask for an agent ID. It is optional.

Freshchat has to tell Amio when an agent answers or resolves a conversation.

  1. In Freshchat, open Settings, then Admin Settings.

  2. Search for Conversational Webhooks.

  3. Set the webhook URL to https://api.amio.io/webhook/freshchat.

  4. Enter an email address that should receive failure notifications.

  5. Save. Amio uses the new-message events from agents and the conversation-resolved event.

    Freshchat Conversation Webhooks with the webhook URL and the failure notification email

Send customer details to Freshchat (webchat)

Section titled “Send customer details to Freshchat (webchat)”

When the channel is webchat, you can fill in the Freshchat user from your page with setMetadata. Put the fields in a freshchat_user object. All fields are optional. They are applied when the Freshchat conversation is created.

window.amioWebchat.init({
channelId: 'YOUR_CHANNEL_ID',
externalContactId: 'your-user-id'
})
window.amioWebchat.setMetadata({
freshchat_user: {
reference_id: 'your-user-id',
email: 'customer@example.com',
first_name: 'Jana',
last_name: 'Novakova',
phone: '+420123456789'
}
})

externalContactId is optional. It keeps the history the same when the customer returns from another device or browser.