---
title: "Telegram Integration with Catchpoint Alert"
slug: "telegram-integration-with-catchpoint-alert"
updated: 2023-01-06T15:48:57Z
published: 2023-01-06T15:48:57Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.catchpoint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Telegram Integration with Catchpoint Alert

## 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

1. Open the Telegram Client
2. Do a search for “BotFather” and select **@BotFather**
3. Click on **Start Conversation**  

![Tele_1.png](https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/360095826591-Tele_1.png)
4. Type in the following to create a new bot:  

`/newbot`
5. Give the bot a name (in our example, **CatchpointAlert** is the name)
6. Give the bot a unique username.  

NOTE: The username much end with “bot”. (In our example **CatchpointAlert_bot** is the name)  

![tele_2.png](https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/360095826691-tele_2.png)  

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.***
7. Start a conversation with the Bot by searching for the Bot name that was just created, and then enter the following. `/start`  

![tele3.png](https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/360095875492-tele3.png)
8. Get the **Chat ID** by open the following URL in your web browser: `https://api.telegram.org/bot&lt;TOKEN&gt;/getUpdates` (replace `&lt;TOKEN&gt;` with your bot token)  

![tele4.png](https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/360095826811-tele4.png)

## Catchpoint Setup

1. Go into the Catchpoint portal and navigate to **Settings > API**  

![api1.png](https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/4402411412237-api1.png)
2. Create an **Alert Webhook** entry.
3. 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`
4. URL to be placed in the Alertwebhook on the Catchpoint portal will follow the below format.   

`https://api.telegram.org/bot&lt;URL Encoded TOKEN&gt;/sendMessage`

### In the Template put in Format as Text.

![tele5.png](https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/360095875772-tele5.png)

In the Template field, enter the **$CHAT_ID** and what you’d like to see in the message..

`chat_id=$CHAT_ID text=’&lt;your message&gt;’`

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](https://docs.catchpoint.com/docs/alert-webhook-macro-index)

- Next, click on **Add API Header Request** and input the following header.  

![tele6.png](https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/360095827471-tele6.png)

`Content-Type : application/x-www-form-urlencoded` ![tele7.png](https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/360095827551-tele7.png)

- Click **Save** at the top of the page.

![tele8.png](https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/360095876232-tele8.png)

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

![tele9.png](https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/360095876252-tele9.png)

## Results

![tele10.png](https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/360095827671-tele10.png)
