Skip to main content

Zendesk Chat as an inbound channel

Zendesk Chat is online chat software.

caution
To connect a project to Zendesk Chat, you must be on one of the Enterprise plans.

To use Zendesk Chat as an inbound channel:

  1. Configure the Zendesk Chat service.
  2. Create a channel in JAICP.
  3. Develop a script.
  4. Test the bot.

Configure the service

Register on Zendesk Chat or sign in. You will get to the Support page. It is a workspace for the Zendesk Chat agent.

Then, click in the right upper corner and select Chat. In this section, you can connect a bot and configure messaging.

API client

In the dashboard, click Settings → Account. Go to the API & SDKs tab and click Add API client.

Fill out the fields:

  • Client name — a name shown to users when asked to grant access to your application or when viewing the list of apps that have been granted access.
  • Company — a company name to display when users are asked to approve access to your application.
  • Redirect URLs — URL (s) that Zendesk Chat should use to redirect users after they decide whether or not to authorize your application to access Zendesk Chat.

Click Create API client.

Copy the client ID and private key. You will need them further on receiving a Token.

Token

In the search bar, enter the address:

https://www.zopim.com/oauth2/authorizations/new?response_type=token&redirect_uri={URL for redirection}&client_id={client ID}&scope=read%20write%20chat&subdomain={subdomain}

Where:

  • redirect_uri is a URL used for redirection. Decode it into ASCII before inserting it into the address.
  • client_id is the client ID you have copied.
  • subdomain is your account subdomain. You can copy it from the browser address bar: https:/{subdomain}.zendesk.com/.

On visiting the specified address, sign in and provide access to the account. After that, you will see the token on the specified redirection URL. Copy the token from the browser address bar:

https://{URL for redirection}/#access_token={token value}&token_type=bearer&scope=read+write+chat

Agent

Create accounts for agents. For that, in the dashboard, click Settings → Agents → Add agent and enter information for a team member.

To add accounts to a department, in the dashboard, click Settings → Departments → Add department.

Create a channel in JAICP

Go to JAICP. In the dashboard, click Channels → Inbound → Connect channel. In the Others section, select Zendesk Chat.

Specify the settings:

  • Name is the channel name.

  • Token is the token you have copied.

  • Branch is the project branch you want to deploy into the channel (master by default). You can also select a Git tag or enter a specific commit hash.

  • Deployment is one of the two deployment options:

    • Automatic: when you save the changes into the project.
    • Manual: with the Deploy button in the channel description.
    caution
    You have to deploy a script before starting the bot. At this stage, the system builds the bot, checks the script syntax, and performs tests.

Click Create. Wait for the pop-up window with the result of the deployment.

Develop a script

When developing a script, mind the following:

  • You can specify the department a client will be redirected to. For example:
state: Transfer to agent
intent!: /agent
a: Just a second, I am redirecting you to a support agent!
script:
$response.zopim = {
needResponse: true,
departmentName: 'Just AI'
};
# ...
  • You can add tags for a dialog:
state: Tags
# ...
script:
$response.zopim = {
tags: ["tag1", "tag2"]
};
# ...
  • Text messages must be added for buttons. For example:
state: Authorization key
# ...
a: Have you got an authentication key?
buttons:
"Yes"
"No"
# ...

Test the bot

To test the bot, change the chat status to Online. For that, in the right upper corner, click and select Support. Then, in the right upper corner, click and select Online. Now, your bot can receive client messages.

After that, return to the  → Chat tab. In the dashboard, open Settings → Widget → Embed Web Widget. Copy the script and insert it into the HTML code of your site between the <head> tags.

tip
Insert the script to each page where you want the widget to be shown on.

Go to the dialog with the bot on your webpage. Then, send a welcome / an activating phrase stated in your scenario to the bot. After that, your dialog with the bot starts.