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 like 123456789:ABCdef…).

  • A destination chat ID:

    • Private chat — a positive integer. The recipient must send /start to 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>/getUpdates and read result[].message.chat.id.

Configuration

FieldRequiredDescription
Bot TokenYesThe HTTP API token from @BotFather. Verify it with https://api.telegram.org/bot<token>/getMe (returns ok: true). Stored as a secret.
Chat IDYesDefault destination for messages. Can be overridden per event in the blueprint.

Configure in Signal

  1. In the management UI, go to Integrations and add Telegram.
  2. Paste your Bot Token and Chat ID.
  3. Attach the integration to a pipeline and select the Conversion Alerts preset (or build your own event mappings).
  4. Save. Signal begins posting messages for matched events.

API Endpoint

Signal sends each event as a POST to:

https://api.telegram.org/bot<token>/sendMessage

The 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 eventMessage titleDetail linesDefault
purchaseNew orderOrder ID (transaction_id, else order_id); value and currency (value, else revenue; currency upper-cased)On
generate_leadNew leadLead type; value and currencyOn
sign_upNew sign-upSign-up method; planOn
subscription_startedNew subscriptionPlan; value and currencyOff
Every other event, page views includedDropped

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

  1. With your bot token, confirm the bot is reachable: open https://api.telegram.org/bot<token>/getMe — you should see { "ok": true }.

  2. 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 200 with "ok": true means the bot can post to that chat.

  3. Trigger one of the mapped events (e.g. complete a test order) and confirm the message arrives in the chat.

Troubleshooting

SymptomCauseFix
401 UnauthorizedInvalid bot tokenRe-copy the token from @BotFather; check for stray spaces.
400 chat not foundWrong chat ID, or bot never interacted with the chatRe-check the ID via getUpdates; for private chats the user must /start the bot first.
403 bot was blocked by the userRecipient blocked the botNothing to fix server-side; the user must unblock the bot.
403 need administrator rightsPosting to a channel without adminMake the bot an admin of the channel.
400 can't parse entitiesA 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 RequestsSending faster than Telegram allowsHandled automatically (Signal retries after retry_after); reduce alert volume for very busy pipelines.
No message arrives, no errorEvent dropped by the blueprintConfirm the event name is in the preset’s events map (others are dropped by default).