Telegram Integration Guide

Bright Pattern Documentation

Generated: 9/25/2021 8:21 am
Content is available under license unless otherwise noted.

About

The Bright Pattern Contact Center Telegram Integration Guide provides instructions for setting up your Bright Pattern Contact Center to function in an integrated manner with your business’s Telegram official account.



Audience

The Telegram Integration Guide is intended for the IT and/or technical personnel responsible for the data infrastructure of the contact centers that use Bright Pattern Contact Center solutions for customer interaction processing. Readers of this guide are expected to have experience in administration of these systems, as well as a solid understanding of contact center operations and resources that are involved in such operations.



Prerequisites

Telegram integration requires that you have admin-level access to both Bright Pattern Contact Center and your organization’s Telegram official account.

Software Versions

For all types of integration described in this guide, the following is required:




Integration Configuration

When Bright Pattern Contact Center is integrated with Telegram, your Bright Pattern Agent Desktop environment is equipped to handle customer-initiated interactions from the Telegram app on a customer’s mobile phone, tablet, or computer. Incoming chat interactions are routed to the integrated Agent Desktop environment, where agents have direct access to the phone, live chat, email, SMS text, various other mobile messenger apps, customer and agent records, interaction details, and more.

Integration configuration involves linking your business’s Telegram bot to your Bright Pattern Contact Center tenant.

To configure Telegram integration, you will need system access to

The Telegram application contains the settings for your bot, webhook, and access token. Your Telegram account username is what is used as your organization’s identity. Messaging events for your Telegram account are sent securely to your webhook. Contact Center Administrator is where you add the Telegram integration account to your Bright Pattern tenant.

Configuration Procedure

Step 1: Create a Telegram account

  1. Go to https://my.telegram.org and download and install either the mobile app (Telegram Messenger for Android/iOS), or the desktop app (Telegram for PC/Mac/Linux). If you choose the desktop app, all your Telegram activities will be synced with your mobile phone. This example shows the desktop app.

  2. After installation, launch the app and click Start Messaging.

    Telegram Desktop welcome dialog


  3. Log in to Telegram in one of two ways:

    1. Enter your mobile phone number and click Next. You will receive a login code to continue logging in to Telegram. The code will be sent to your phone, either in the Telegram app in chat, or via SMS/text. When prompted, enter the login code to finish logging in.

      Your Phone Number screen; enter your mobile phone number to log in


    2. Click Quick log in using QR code and follow the instructions on the screen to scan the QR code with your phone (if you already have installed the Telegram Messenger app on your phone) and log in.

      Scan from Mobile Telegram screen; follow the instructions to scan the QR code with your phone and log in


  4. Create a username for your Telegram account. The username is what appears in your Telegram account’s URL, profile, and search results. A username enables Telegram users to search for your business by name (e.g., “Bright Pattern”) by typing the “@” symbol followed by your username into a search box (e.g., “@Brightpattern”). If you do not have a username, Telegram users must know your phone number in order to contact you. You will need your username later in this configuration procedure. See Telegram’s F.A.Q. pages for more information.

You can create a username in Telegram Settings > Edit profile > Add username.

Saving a username in Telegram Settings



Step 2: Create a bot

Telegram bots are third-party applications that run inside Telegram. They interact with users, performing complex tasks such as sending notifications, integrating with tools, social networking, and much more. As with all other Telegram bots, yours will be called a username with “bot” at the end of it (e.g., “brightpattern_bot”). You will use your bot to chat with users on Telegram. Refer to Telegram’s instructions for creating a new bot, which are summarized as follows:

  1. Sign in to your organization’s Telegram account.

  2. In the Search box, search for the BotFather bot (“@BotFather”), select its username, and click Start to begin chatting with the bot.

    Work with BotFather to create a new bot


  3. Type the command /newbot into the chat window with BotFather.

  4. Follow BotFather’s prompts for information, and provide:

    1. Name of your new bot

    2. Username of your new bot (must end with “bot”)

BotFather will provide information regarding your bot, including its URL, access token, and links to help pages. Type the command /mybots to edit your new bot. The menu that appears will include the following options to edit:

Edit bot options


Step 3: Update your bot profile

Click the Edit Bot button to update your bot profile. Your bot is your business’s main point of contact on Telegram. You should complete the following sections of your profile, so that other users will know who your bot is, what it does, and generally what your brand is about.


New bot profile


Step 4: Get the access token

  1. Click the API Token button to get the API token to handle chat interactions. You will need this token to add a Telegram integration account in the Contact Center Administrator application.

  2. Select the entire token and copy it.


Get the API token


Step 5: Create a new integration account in Contact Center Administrator

  1. Log in as Admin to the Contact Center Administrator application.
  2. Navigate to Configuration > Integration Accounts.
  3. Click the Add + button to add a new account.
  4. In the Create integration account window that appears, select Messenger and click OK.

Step 6: Specify Telegram integration account properties

Using the credentials for your Telegram App, enter values for the following screen properties. (If you do not know your credentials, ask your system administrator.)

Click Apply to save your changes.


Telegram integration account


Next Steps

Your integration account is now configured for Telegram. Next, you will tailor your chat scenario to handle chat interactions, as well as do a real test of your connection by responding to chat interactions from within the Agent Desktop application.




Customizing Interactions Using Scenarios

You can determine how Bright Pattern Contact Center handles Telegram messages and Telegram customer data directly from Bright Pattern scenarios.

For every customer interaction that enters your contact center, Bright Pattern Contact Center has to process that specific interaction to determine what to do with it (e.g., what prompts or announcements to apply, what resources to queue for, what music to play, or when to overflow to alternate resources). The logic of such automated interaction processing is defined in scenarios. Execution of a scenario with respect to a specific interaction is triggered by a particular event, such as the initiation of a chat session from a specific web page or app.

Scenarios are designed and edited in the application called Scenario Builder. This application is launched from the Contact Center Administrator application when you add a new scenario or select an existing one for editing. For more information, see the Contact Center Administrator Guide, section Scenarios Overview.

Note that your contact center (i.e., tenant) can have multiple Telegram integration accounts if it has multiple scenario entries. Each scenario entry can have only one Telegram account (one maximum for each messenger type). Each service can have one Telegram account as an outbound chat account. The same Telegram account can be assigned to one scenario entry/service only.




Scenario Configuration

The following steps will walk you through the process of creating a scenario.

Step 1: Create a web chat scenario

  1. In the Contact Center Administrator application, navigate to Configuration > Scenarios > Chat.

  2. At the bottom of the screen, click the Add "+" button to add a new chat scenario. Alternatively, you may select and edit the web chat scenario template called "Mobile Chat."

Step 2: Specify screen properties for the scenario

Screen properties for the scenario are displayed on the right side of the screen. Specify all values as you would for any other chat scenario. For more information on such screen properties, see the Contact Center Administrator Guide, section Chat.

Pay particular attention to the field called Messenger Accounts. In this field, select the username of your Telegram account or add a new one by clicking the add/edit link.


Telegram chat scenario


Step 3: Customize your scenario in Scenario Builder

  1. Open your new scenario by double-clicking its name in the Chat list on the left. The scenario will open in the Scenario Builder application.

  2. Before you do anything else, save your scenario by clicking the Save As button and giving this scenario a unique name, such as "Messenger Chat," to differentiate the new scenario from the scenario template.




Scenario Blocks

Actions or prompts called blocks are organized in each scenario, forming the order of operations for a specific service. For Telegram integration, this service is a chat service, and the scenario tells the Bright Pattern system how to route messages from customer to agent, what information to collect from the customer, what automatic messages to present to the customer, and what conditional exits to take in a variety of situations.

In the example shown, the web chat scenario template called "Mobile Chat" has been opened for editing and renamed "messenger chat." You should use this scenario as a base for yours, customizing the screen properties of each block to suit your chat service. For more information on these blocks, refer to the Bright Pattern Contact Center Scenario Builder Reference Guide.

To access Telegram data from a scenario, the following scenario blocks should be present in your scenario, in this order. If they are not, drag them onto the center pane of Scenario Builder.

  1. Send Message
  2. Send Message
  3. If
  4. Find Agent
  5. Send Message
  6. Connect Chat
  7. Send Message
  8. Exit


Messenger chat scenario example


Send Message

The Send Message block is used to send a text message to a chat/mobile/messenger customer via SMS. More information about Send Message settings is available in the Scenario Builder Reference Guide, section Send Message.

If

The If block allows branching of a scenario based on verification of some specified conditions. Multiple conditional exits (branches) can be configured in the same block.

For examples of how this block is used, see the Scenario Builder Reference Guide, section If.

Find Agent

The Find Agent scenario block finds an agent qualified to handle a given interaction. When the agent becomes available, the block creates a variable called $(destination) and sets it to the agent’s phone number (for voice) or username (for chat).

For descriptions of this block’s screen properties, see the Scenario Builder Reference Guide, section Find Agent.

Connect Chat

The Connect Chat scenario block connects a chat to the destination specified in the $(destination) variable (typically, the agent found by the preceding Find Agent block or to the specified chat scenario entry). If the agent is logged in, the system tracks the agent’s state according to the state of the interaction. The block handles the call transfers and conferences internally and only ends when the remote party disconnects or the last agent disconnects.

For descriptions of this block’s screen properties, see the Scenario Builder Reference Guide, section Connect Chat.

Exit

The Exit scenario block disconnects the currently active interaction and exits the scenario.

For descriptions of this block’s screen properties, see the Scenario Builder Reference Guide, section Exit.




Using Telegram on Agent Desktop

Designed to increase agent productivity, the Bright Pattern Contact Center Agent Desktop application displays only the controls and information needed at each point of work.

Incoming Telegram messages are routed to agents using the "Messenger Chat" scenario that you created in the Customizing Interactions Using Scenarios section of this guide. Telegram messages are delivered as “Customer Service Chats” and look the same as other web chats or mobile chats that are normally sent to agents.


Chatting on Telegram from the Agent Desktop


Login

  1. Log in to Agent Desktop with your username and password, being sure to select your desired phone device.

  2. By default, you log in with a softphone. To choose another device, click the current Phone device setting and select the desired type of device from the menu that appears. For more information about the available device options, see the Bright Pattern Contact Center Agent Guide, section Selecting a Phone Device.

  3. Click the Login button.

  4. Note that if this is your first time logging into Agent Desktop on the given computer, you will be prompted to install the Agent Desktop Helper Application.


Ready State

Setting the agent state to Ready will allow incoming chat interactions to be routed to you. Agents can accept or reject chat interactions while logged in and ready. If accepted, the customer’s message is shown in the Chat Panel of Agent Desktop in the same manner as any other web chat or SMS text. All of Agent Desktop’s features and controls are available in the integrated interface.

Agents can:


Refer to the Bright Pattern Contact Center Agent Guide to learn more about the Agent Desktop user interface and its applications.




Customer View

For the customer, the Telegram chat looks the same as any other normal Telegram interaction.


Telegram conversation on mobile