Telegram
Datafly Signal delivers events server-to-server to the Telegram Bot API, posting a formatted chat message for each matched event. Use it for operational and sales alerting — a message in your team’s channel when an order completes, a sign-up happens, or a lead is captured. Because delivery is server-side, no bot token is ever exposed in the browser.
Why route Telegram through Datafly Signal
- Alerts fire off the same event stream as everything else. No separate instrumentation, and no gap between what your destinations received and what Telegram told you about.
- Which events reach you is configuration, not code. The trigger conditions live in the pipeline alongside every other rule, so tuning what reaches Telegram does not require an application release.
- Alert volume is rate-limited. Signal applies the same rate limiting and retry behaviour it uses for any destination, so an incident that spikes your event rate does not flood the channel.
Prerequisites
-
A Telegram bot. Create one by messaging @BotFather, running
/newbot, and copying the HTTP API token it returns (looks like123456789:ABCdef…). -
A destination chat ID:
- Private chat — a positive integer. The recipient must send
/startto your bot first. - Group / supergroup — a negative integer (supergroups are prefixed
-100). The bot must be a member of the group. - Channel —
-100…or the public@channelusername. The bot must be an admin of the channel to post.
The quickest way to find a chat ID: add the bot to the chat, send a message, then open
https://api.telegram.org/bot<token>/getUpdatesand readresult[].message.chat.id. - Private chat — a positive integer. The recipient must send
Configuration
| Field | Required | Description |
|---|---|---|
| Bot Token | Yes | The HTTP API token from @BotFather. Verify it with https://api.telegram.org/bot<token>/getMe (returns ok: true). Stored as a secret. |
| Chat ID | Yes | Default destination for messages. Can be overridden per event in the blueprint. |
Configure in Signal
- In the management UI, go to Integrations and add Telegram.
- Paste your Bot Token and Chat ID.
- Attach the integration to a pipeline and select the Conversion Alerts preset (or build your own event mappings).
- Save. Signal begins posting messages for matched events.
API Endpoint
Signal sends each event as a POST to:
https://api.telegram.org/bot<token>/sendMessageThe bot token is carried in the URL path — Telegram has no separate authorization header. The request body is JSON:
{
"chat_id": "-1001234567890",
"text": "New order\nOrder: 1234\nValue: 49.99 GBP"
}A success response is { "ok": true, "result": { … } }. Failures return { "ok": false, "error_code": <int>, "description": "…" } with a matching HTTP status (400 bad request, 401 invalid token, 403 bot blocked or not an admin). Rate-limit responses (429) include a retry_after and are retried automatically.
Identity Signals
No identity data is sent: no email, phone, name, address or user ID reaches the chat.
Turn on Only send mapped fields (strict_output_contract) for this integration. It is the default for integrations created since the strict contract became the default; an integration created before it, or one set to forward unmapped fields, also sends every property the blueprint did not map, which can include personal data added by identity enrichment (#1557).
Event Mapping
| Signal event | Message title | Detail lines | Default |
|---|---|---|---|
purchase | New order | Order ID (transaction_id, else order_id); value and currency (value, else revenue; currency upper-cased) | On |
generate_lead | New lead | Lead type; value and currency | On |
sign_up | New sign-up | Sign-up method; plan | On |
subscription_started | New subscription | Plan; value and currency | Off |
| Every other event, page views included | Dropped |
A missing value shows as -, and an over-long value is truncated so the text stays within Telegram’s 4,096 characters. No message carries the visitor’s email, phone, name or address.
Messages are plain text (no parse_mode): with HTML or Markdown parsing, a <, > or & in an event value would make Telegram reject the message. The message is sent to the configured chat_id; a message without text is not sent.
Example
{
"chat_id": "-1001234567890",
"text": "New order\nOrder: ORD-001\nValue: 129.99 GBP"
}Testing
-
With your bot token, confirm the bot is reachable: open
https://api.telegram.org/bot<token>/getMe— you should see{ "ok": true }. -
Send a test message manually to confirm the chat is reachable:
curl -X POST "https://api.telegram.org/bot<token>/sendMessage" \ -H "Content-Type: application/json" \ -d '{"chat_id":"<chat_id>","text":"Signal test ✅"}'A
200with"ok": truemeans the bot can post to that chat. -
Trigger one of the mapped events (e.g. complete a test order) and confirm the message arrives in the chat.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
401 Unauthorized | Invalid bot token | Re-copy the token from @BotFather; check for stray spaces. |
400 chat not found | Wrong chat ID, or bot never interacted with the chat | Re-check the ID via getUpdates; for private chats the user must /start the bot first. |
403 bot was blocked by the user | Recipient blocked the bot | Nothing to fix server-side; the user must unblock the bot. |
403 need administrator rights | Posting to a channel without admin | Make the bot an admin of the channel. |
400 can't parse entities | A custom mapping added parse_mode and an event value contains <, > or & | Remove parse_mode: the preset sends plain text for this reason. |
429 Too Many Requests | Sending faster than Telegram allows | Handled automatically (Signal retries after retry_after); reduce alert volume for very busy pipelines. |
| No message arrives, no error | Event dropped by the blueprint | Confirm the event name is in the preset’s events map (others are dropped by default). |