Telegram Integration with XCALLY
Telegram Account Configuration
Follow these steps to create a Telegram service (bot) and enable its integration with XCALLY Motion:
Access to the Telegram bots app https://t.me/botfather
Type /newbot to create a new bot
Choose a name for your bot
Choose a username for your bot. It must end in bot.
Save the BOT token to access the HTTP API. We will need it to setup the Telegram plugin.
Now your Telegram service is completed!
XCALLY Configuration
In this section you’ll see how to install and configure the XCALLY Motion Telegram Plugin interface, in order to let your Agents interact with Telegram users.
In this phase of the process, you need to access your XCALLY Motion as Admin.
Setup Telegram Account
Access the Open Channel Section:
Create a new Open Channel Account in your XCALLY Motion, clicking on the plus button and filling the fields:
To configure the Telegram Account:
Select the Telegram Account in the list of Openchannel Accounts, click on the button and Edit it:
Check the information and complete the Telegram Account configuration:
Save the Token. We’ll need it to setup the Telegram plugin.
3011 OLD PORT…. QUESTO SCRIPT FUNZIONA CON V3?
Info | |||||
---|---|---|---|---|---|
The default Reply URL is http://localhost:3011/sendMessage and you usually don't need to change it. But if the 3011 port is already in use (or you want to change it for any other reason), you can modify its value here and also in the configuration file: just before installing the plugin, unzip the files and change the property of the Port variable in the following file: server/config/config.json.
At the end of these changes, zip all the folder files and upload the plugin you modified. |
Perché dovrei farlo?
Warning |
---|
Don't forget to select telegram (or any other custom field of the Customer profile) as mapKey and add the proper Agents to the account used for Telegram interactions. |
Setup Telegram Queue
In order to have Agents receive notifications from the Telegram Account and manage interactions, you need to configure a specific Queue.
Follow the next steps:
Create a new Open Channel Queue, as Telegram Queue.
Add Agents or Teams to the Telegram Queue.
Associate he Telegram Queue to the Telegram Account.
Please refer to this documentation to complete this phase of the process.
Generate API Key
Plug-ins, as Telegram, are connected to XCALLY Motion through the API Key.
To generate the API Key, go to the Staff section and open the User section
Select your Admin user and press on the three dots button to Edit it:
Click on the API Key Manager Icon:
Generate the API KEY, clicking on GENERATEbutton:
Save the API Key. We will need it to setup the Telegram plugin.
Upload the Plugin to XCALLY Motion
It is necessary to upload the plugin.
Download the Telegram Plugin zip file:
View file | ||
---|---|---|
|
Open the App Zone section
Upload the Telegram Plugin:
After the upload, you will find it in the list of the uploaded App Zone Plugins:
To Install the plugin, click on button, and click Install plugin:
Click on the button to edit the plugin. Select in the Sidebar field how/to whom this integration must be shown in the menu (default value: Admin Only):
Now your Telegram Plugin is active!
Setup Telegram Plugin
To configure the Plugin for Telegram, access the Plugins section and select Telegram Openchannel.
Fill and check the fields:
Webhook (XCALLY Motion Omnichannel): Insert the Openchannel URL previously saved. dove lo prendiamo?
If you use proxy configuration, customize the folowing URL: https://<PUBLIC DOMAIN>/api/plugins/webhook?port=9000&path=/api/openchannel/accounts/<OPENCHANNEL ID>/notify
API Key (Admin): Insert the API Key previously saved
Port: Plugin port (choose a different port for each plugin)
URL (public) XCALLY Motion: Enter the public XCALLY Motion URL
Proxy token: If necessary, insert the proxy token
Telegram section
Bot Token: Insert the Telegram token previously saved
Message in case of unsupported message: Message that appears to your Customers in case of unsupported message
Message in case of network fail: Message that appears to your Customers in case of network fail
Message in case of file upload fail: Message that appears to your Customers in case of file upload fail
Remember to Restart the Plugin:
Go to the App Zone section, select the Telegram plugin
click on the button and choose the Restart plugin command:
Now you can test the communication between the Telegram users (who will write messages to the Telegram Bot you created) and your Agents (who will interact from the XCALLY Omnidesktop Interface)!
Telegram Interactions
Info |
---|
The integration allows you to exchange text or attachments. Each message could transfer a text message or a file at a time. |
Additional Information
Configuring your firewall
If your XCALLY service is hosted behind a firewall then please make sure that the HTTPS port is able to accept incoming requests from Telegram webhook server.
A few suggestions in this regard:
Try to find the IP address for Telegram server, that is sending webhook requests to XCALLY, using your preferable network analysis tool.
Add the rule to allow incoming traffic from Telegram IP address, on Port 443, in your firewall policy.
-- OR --
Modify the file /etc/sysconfig/iptables and add the following line:
-A INPUT -s 0.0.0.0/0 -p tcp --dport 443 -j ACCEPT
Disclaimer: This method will open port 443 of your XCALLY server for all IP addresses.
-- OR --
Accordingly to the following link https://core.telegram.org/bots/webhooks you can open just the following TCP ports from the specified networks:
149.154.160.0/20
and
91.108.4.0/22
on port 443, 80, 88, or 8443.
Debugging/Troubleshooting
All of the log files for Telegram Messenger plugin events are available at /var/log/xcally/ directory under openchannel-line- naming convention.