Telegram Integration | Xitoring Document

Telegram Integration

Telegram is a globally used, cross-platform, cloud-based instant messaging service. As Telegram is one of the most used messaging apps in the world right now, Xitoring is providing this feature so users can get their Notifications and Incidents in Telegram.

In this guide, we will walk you through the process of setting up the Telegram integration in Xitoring. We will provide step-by-step instructions for configuring your notification role settings and connecting your Telegram account to Xitoring. By the end of this guide, you will be ready to start receiving incident notifications in real-time via Telegram, helping you stay on top of your incidents and keep your systems running smoothly.

Set up Telegram Integration

There are a few easy steps to enable Telegram notifications.

Create a Telegram Channel

It doesn't matter if it's a private or a public channel you just need to create a channel and proceed to the next step.

Add Xitoring_bot as an admin

From the main setting of your channel add @xitoring_bot as an administrator with At least Post message permission.

Get your channel ID

This is the hard part as Telegram does not provide an easy way to show the Channel ID:

To access a channel id in Telegram, you'll first need to login to Telegram web on your PC and select the channel you created for Xitoring in Telegram web. Once you've done this, take a look at the URL in your web browser. It should look something like this: https://web.telegram.org/k/#-YYYYYYYYYY.

The ID you need to use for the channel is embedded within the URL. However, To obtain the ID for the private channel, you'll need to add 100 between the minus symbol and the YYYYYYYYYY numbers. This means that the ID for the private channel will be in the format of -100YYYYYYYYYY.

If you prefer, there is an alternative method to obtain the ID for a channel. You can send a message in your Telegram channel or group (using either the mobile app or Telegram web), and then forward that message to @JsonDumpBot. This bot will then dump a complete JSON of all requests it receives, which will look something like this:

{
  "update_id": 134262316,
  "message": {
    "message_id": 232258,
    "from": {
      "id": 5628604286,
      "is_bot": false,
      "first_name": "Xitoring",
      "username": "bot",
      "language_code": "en"
    },
    "chat": {
      "id": 5635470266,
      "first_name": "Xitoring",
      "username": "bot",
      "type": "private"
    },
    "date": 1639975212,
    "forward_from_chat": {
      "id": -1003270024809,
      "title": "Xitoring",
      "type": "channel"
    },
    "forward_from_message_id": 10,
    "forward_date": 1639975212,
    "text": "[TEST] ping on (test-notificatio...",
    "entities": [
      {
        "offset": 16,
        "length": 30,
        "type": "url"
      }
    ]
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

Look for the property forward_from_chat in the JSON and copy the ID from it. In this example, the ID that you need is -1003270024809 which is in line 20 of the code block above.

Final Step

After getting your channel ID you just need to enter the channel id in the notification role which you are configuring. and after that, all of the incidents and notifications will be sent to your Telegram as you configured, You can click on Send a Test Notification button in the notification role to get a test notification and make sure you have set up everything right.

Last Updated: 4/12/2023, 9:34:28 PM