Set up Telegram

This guide goes with the Telegram configuration page (Settings → Integrations → Telegram → Configure). It is the quickest notification channel to turn on: no business verification or templates, and you have the bot in a few minutes. The steps are numbered the same way as the hints under each field.

1. What the page asks for

Under “Basic Configuration”, an “Integration Name” and the “Environment”. Under “Credentials”: the “Bot token” (step 1), the “Bot username”, which ends in “bot” and is used in the “Connect Telegram” link, and the “Webhook secret”, which you make up (steps 2 and 5).

After “Save Configuration”, “Test Connection” and “Register webhook” appear. Each company uses its own bot.

2. Steps 1 to 3: create the bot

Step 1. In Telegram open @BotFather (the official one, with the blue tick), type /newbot and reply with the bot's display name and a username ending in “bot” (for example, previna_notif_bot). BotFather returns a token that looks like 123456789:AAE…; copy it into “Bot token” and the username, without the @, into “Bot username”. Whoever has the token controls the bot: do not share it.

Step 2. Make up a long random string (32 characters or more) and enter it in “Webhook secret”.

Step 3 (optional). In @BotFather you can give the bot a description and a picture with /setdescription and /setuserpic.

3. Step 4: save and test

Press “Save Configuration” and then “Test Connection”. If the token is valid, the integration becomes active. From then on goPrevina can send notifications to anyone whose Telegram account is linked.

4. Step 5: register the webhook

For each user's linking to work, Telegram has to forward to goPrevina the /start the user sends. With the integration saved, press “Register webhook”: the platform registers it with your API's public address and the secret from step 2, and tells you whether Telegram accepted it.

Telegram only accepts HTTPS addresses reachable from the internet; on an installation without one, registration fails. Without the webhook sending works, but the users' “Connect Telegram” button does not complete the link.

5. Step 6: each user connects their Telegram

Each person does this, not the administrator. In Notification preferences press “Connect Telegram”: the bot opens with a one-time link. Press “Start” in Telegram and the card changes from “Not connected” to “Connected”. Then tick the Telegram column for the notifications you want to receive there.

If “Test Connection” fails, check the token. If linking does not complete, the webhook still needs registering (step 5).