Telegram integration tutorial
The Telegram Integration for Tiledesk allows you to expand customer service by exchanging messages between Telegram and Tiledesk support. This integration connects your company's Telegram bot to your Tiledesk account, creating a tunnel between the two platforms. Customers can reach your support by messaging your Telegram bot; those messages will be delivered to the Tiledesk webchat along with messages from other channels, so agents have a single work environment.
Steps
The following are the steps involved in this tutorial:
Create a Telegram Bot
Open Telegram (desktop or mobile) and start a conversation with @BotFather: https://t.me/botfather.
Send the command /newbot to create a new bot, then follow the prompts to choose a name and a username.
Your bot will be created and BotFather will provide a token — keep this token; you'll need it soon.
Configure the Webhook
Use Replit to quickly create a Node.js endpoint. Fork the tutorial app: https://replit.com/@GiovanniTroisi/tiledesk-telegram-tutorial-app#index.js and give it a name.
In the Tiledesk Console, go to your project's Settings > Project Settings > General and copy the Project Id.
Paste the Project Id into the index.js file of your Replit app.
In Tiledesk Console, go to Settings > Project Settings > Developer and press "GENERATE SHARED SECRET". Note: generating a new secret invalidates previous ones.
Click "Copy" for the shared secret and paste it into the index.js file on Replit.
Subscribe to a Webhook on Tiledesk
In Tiledesk Console, go to Settings > Project Settings > Developer and click "MANAGE WEBHOOK".
Click "ADD SUBSCRIPTION".
In the New Subscription popup:
Select "Message Create (only for Telegram channel)".
Set the Webhook Target to the same Replit URL as before, but append "/tiledesk" to it.
Click "CREATE SUBSCRIPTION". You will be shown a webhook secret — save it securely (it is displayed only once). See webhook APIs: https://developer.tiledesk.com/apis/webhooks/subscriptions
The Webhook is now configured.
Test the integration
In Telegram, open your bot (by name, username, or via the link provided by @BotFather) and click "Start".
A default message ("/start") will be sent to the Tiledesk webchat — an agent can now reply.
Messages sent from Tiledesk will be delivered to the Telegram Bot chat as normal conversations.
Done — the integration is completed.
Additional example projects:
Twilio (WhatsApp) example: https://replit.com/@andrealeo83/tiledesk-whatsapp-twilio-app
Facebook Messenger example: https://replit.com/@andrealeo83/tiledesk-facebook-app#index.js
If you have any problems, post on the Community forum: https://tiledesk.discourse.group/
Do you have suggestions on this article? Send feedback by email to [email protected]
Last updated 2 years ago