Proteggiamo il tuo ambiente digitale da qualsiasi attacco informatico. Sfrutta tutte le potenzialità della piattaforma SGBox!

Gallery

Contatti

Via Melchiorre Gioia, 168 - 20125 Milano

info@sgbox.it

+39 02 60830172

Search another article?

Telegram BOT

You are here:
< Back

Configure SGBox to use Telgram API in LCE Module and send alert messages

This articles explain how to configure SGBox to interact with Telegram API in order to send alert messages when a specific event occur.

Requirements:

  • SGBox version 4.2.4 with the LM and LCE modules.
  • A Telegram BOT.

There are many tutorial about how to configure a Telegram BOT. We choose @BotFather for our example.
First you need to create your bot and obtain your TOKEN:

Telegram BOT

Telegram BOT

A token is something like: 1148120703:AbIUGpERusdQDEEag_EL1KDtynRB9sIhbj1.
You need also a the chat_id, so: start and say “Hello” to your bot, than retrieve the chat id:
Telegram BOT

From your browser go to:
https://api.telegram.org/bot1148120703:AbIUGpERusdQDEEag_EL1KDtynRB9sIhbj1/getupdates

Find the ID in the response:
Telegram BOT
id: 124229696

Once created tbe bot, you can go on SGBOX > LCE > Rules > New Rule.
We choose the event [SGBox] Logon OK for our test, but you can choose every event you want. The related action is Call API.
Specify the Telegram API with your TOKEN:
https://api.telegram.org/bot1148120703:AbIUGpERusdQDEEag_EL1KDtynRB9sIhbj1/sendMessage -d chat_id=124229696 -d text="New SGBox Logon"
Telegram BOT

Click Save and give a name to your rule.

If you wan you can also specify a parameter in your message:
https://api.telegram.org/bot1148120703:AbIUGpERusdQDEEag_EL1KDtynRB9sIhbj1/sendMessage -d chat_id=124229696 -d text="SGBox Logon from "
Telegram BOT

When a logon occur, a message will sent from your bot:
Telegram BOT