Synology DSM 7.2: Telegram notifications

Using Telegram as a platform and not only as an instant messaging app is one of the beauties of it. Why not also use it to receive notification coming from systems I manage? Here's a step by step on how you can use it on Synology's DSM version 7.2.

  1. You need to go to the BotFather and create a new bot to receive its token.
  2. Now, start a chat with your bot. Send the /start command and another message afterwards.
  3. On your CLI, run the following command to get your chat identifier: curl https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates | jq '.result[].message.chat.id'
  4. Access your DSM dashboard and open Control Panel.
  5. Go to Notification, click on the Webhooks tab and then Add.
  6. Set the provider as Custom and the rule as you wish. Click next.
  7. The provider name as Telegram, the subject as %DATE% at %TIME% - %HOSTNAME% and the Webhook URL as https://api.telegram.org/bot<YOUR_BOT_TOKEN>/sendMessage.
  8. On the HTTP requests setting, go to Parameter and set two fields: text with @@TEXT@@ and chat_id with the value you got on step 3.
  9. Save and send a test message.

Done, this should be enough to get you telegram notifications.