Important: Telegram “bots” are special accounts controlled by a token, not by a phone number. A single bot can be added to many groups or channels, but every message must reach the bot (via a direct mention, reply, or channel post) for the AI to respond.
🔢 Table of Contents
- Create a Telegram Bot with BotFather
- Retrieve the Bot HTTP Token
- Add & Promote the Bot in Chats / Channels
- Configure Webhooks in Telegram
- Connect Your Bot to ZappWay
- Send a Test Message
- Monitoring & Maintenance
1. Create a Telegram Bot with BotFather
- Open Telegram (desktop or mobile).
-
Search for
@BotFatherand open the verified account. -
Tap Start (or send
/start). BotFather displays a menu of commands. -
Send
/newbot. -
Follow the prompts:
- Bot name – the full display name shown to users (e.g., “ZappWay Support”).
- Username – must end with
bot(e.g.,zappway_support_bot).
-
BotFather replies with:
✅ Copy the token—you will paste it into ZappWay later.
Tip: Your bot is public by default. If you prefer to hide it from search, send /setprivate to BotFather.
2. Retrieve the Bot HTTP Token
- If you lost the token, open BotFather and send
/token, then pick your bot. - Store the token securely (password manager, vault); anyone with this token can control the bot.
3. Add & Promote the Bot in Chats / Channels
3.1 Private Support Chat (optional)
- Open a 1-on-1 chat with your bot.
- Send
/startso the bot is allowed to message you.
3.2 Group Support Chat
- Create or open the group where customers will send messages.
- Tap the group title ➜ Add Member ➜ search your bot’s username ➜ Add.
-
Promote it to Administrator (required so it can read and send all messages).
- Permissions needed: Read messages, Send messages, Manage messages (optional).
3.3 Public or Private Channel
- Open the channel ➜ Manage ➜ Administrators ➜ Add Admin ➜ select your bot.
- Grant Post Messages permission so the AI can publish replies.
Why admin? Telegram only delivers all messages to bots that are admins; otherwise the bot sees mentions only.
4. Configure Webhooks in Telegram
Telegram delivers updates to one webhook URL per bot.- Copy the Callback URL and Verify Token shown in ZappWay (you will get them in Step 5).
- Send this HTTPS request (you can use a browser address bar):
- Replace
<YOUR_TOKEN>,<CALLBACK_URL>,<VERIFY_TOKEN>with real values. - Telegram replies with
{"ok":true, "result":true, ...}if the webhook is set.
Note:
- The URL must use HTTPS with a valid certificate.
- A single bot can point to one webhook at a time. Calling
setWebhookagain overwrites the previous URL.
5. Connect Your Bot to ZappWay
- Sign in to ZappWay ➜ Integrations ➜ Telegram ➜ Add Telegram Integration.
-
Paste the HTTP Token you copied from BotFather. Click Continue.
- ZappWay validates the token with Telegram’s
getMeendpoint.
- ZappWay validates the token with Telegram’s
-
ZappWay now displays two read-only fields:
- Callback URL – the endpoint you just set in Step 4
- Verify Token – the
secret_tokenyou passed tosetWebhook
- Click Save. The integration status changes to “Waiting for updates”.
If ZappWay shows “Invalid credentials,” re-check the token in BotFather and repeat Step 5.
6. Send a Test Message
-
From any Telegram account, send “Hello” to:
- the bot directly or
- a group/channel where the bot is admin.
- In ZappWay ➜ Inbox, you should see the incoming message.
- If you configured auto-reply flows, the AI Employee should respond automatically.
Troubleshooting: No message in Inbox?
- Confirm webhook status with
https://api.telegram.org/bot<YOUR_TOKEN>/getWebhookInfo.last_error_messagewill reveal SSL or network issues.- Ensure the bot has permission to read group/channel messages (admin role).
7. Monitoring & Maintenance
7.1 Webhook Health
getWebhookInforeturns fieldspending_update_countandlast_error_date/message.- A non-zero
last_error_datemeans Telegram could not POST to ZappWay. Check firewall/SSL.
7.2 Token Security
- Tokens never expire automatically but revoke them immediately if leaked:
/revokecommand in BotFather ➜ Requires setting a new webhook.
7.3 Scaling & Limits
- Telegram bots can send 30 messages / second overall and 1 message / second per chat.
- Large attachments (video, docs) are delivered as file IDs; ZappWay fetches content on demand.
7.4 Common Errors
| Error Code | Meaning | Fix |
|---|---|---|
| 401 / 403 | Invalid token | Re-paste correct token in ZappWay & setWebhook again |
| 400 “chat not found” | Bot not admin | Add/promote bot in the group/channel |
| 429 | Flood control | Reduce message rate or chunk long replies |
✅ Final Notes
- One webhook per bot – if you experiment in staging, remember to switch back to production URL.
- Privacy Mode – by default, bots do not see every group message. Admin promotion disables privacy mode so the AI can read full context.
- Testing – Always test in a private chat first, then small group, before rolling out to public channels.
- Security – Never share your token in screenshots or logs.
Useful Links
- Telegram Bot API Documentation: https://core.telegram.org/bots/api
- BotFather Command Reference: https://core.telegram.org/bots#botfather
- Webhook Setup Guide: https://core.telegram.org/bots/webhooks

