Introduction
Telegram is a freeware, cross-platform, cloud-based instant messaging software and application service.
Catchpoint’s flexible alerting webhook feature can send alerts to Telegram.
Telegram Setup
- Open the Telegram Client
- Do a search for “BotFather” and select @BotFather
- Click on Start Conversation

- Type in the following to create a new bot:
/newbot - Give the bot a name (in our example, CatchpointAlert is the name)
- Give the bot a unique username.
NOTE: The username much end with “bot”. (In our example CatchpointAlert_bot is the name)

Once the bot is created, you will get a token to access the Telegram API. The token is a string that is required to authorize the bot and send requests to the Telegram API, e.g. 4334584910:AAEPmjlh84N62Lv3jGWEgOftlxxAfMhB1gs**
Capture this token as it will be needed when configuring Catchpoint. - Start a conversation with the Bot by searching for the Bot name that was just created, and then enter the following.
/start

- Get the Chat ID by open the following URL in your web browser:
https://api.telegram.org/bot<TOKEN>/getUpdates(replace<TOKEN>with your bot token)

Catchpoint Setup
- Go into the Catchpoint portal and navigate to Settings > API

- Create an Alert Webhook entry.
- URLencode the token (Replace the semicolon “:” with “%3A”)
For example, the URL:https://api.telegram.org/bot1363564166443:AAHHA3j8snFDw4ZmXN1FzYsipWKvmV4y7Kc/sendMessage
becomes:
https://api.telegram.org/bot1363564166443%3AAAHHA3j8snFDw4ZmXN1FzYsipWKvmV4y7Kc/sendMessage - URL to be placed in the Alertwebhook on the Catchpoint portal will follow the below format.
https://api.telegram.org/bot<URL Encoded TOKEN>/sendMessage
In the Template put in Format as Text.

In the Template field, enter the $CHAT_ID and what you’d like to see in the message..
chat_id=$CHAT_ID text=’<your message>’
Here is an example template:
chat_id=<chat_ID>&text='
"Test Name [Test ID]": "${TestName} [${TestId}]",
"Test Information": [{
"name": "Test Type",
"value": "${switch("${testTypeId}","0","WEB","1","TRANSACTION","2","HTML CODE","3","FTP","4","TCP","5","DNS","6","PING","7","SMTP","8","UDP","9","API","10","STREAMING","11","SSH","12","TRACEROUTE","13","WEBSOCKET")}"
},
{ "name": "Monitor",
"value": "${switch("${MonitorTypeId}","0","IE","2","OBJECT","18","CHROME","3","Emulated")}"
}
],
"Notification Level":"${switch('${notificationLevelId}','0','warning','1','critical','2','recovery','3','recovery')}",
"timestamp":${AlertInitialTriggerDateUtcEpoch},
"Node(s) location": "${nodeDetails(${nodeName}, ) }",
"outage Information": "alert type is ${AlertType}. The URL is ${TestUrl}. waterfall URL is ${waterfallChartURL}"
Here is a list of Alert Macros you can use Alert Webhook Macro Index – Catchpoint Help
- Next, click on Add API Header Request and input the following header.

Content-Type : application/x-www-form-urlencoded

- Click Save at the top of the page.

This will result in Alerts going into Telegram once Tests have been assigned the Telegram Alert Webhook.

Results
