# How to make alerts with telegram bot?

**URL:** <https://discuss.elastic.co/t/how-to-make-alerts-with-telegram-bot/282794>\
**Category:** Kibana\
**Tags:** elastic-stack-alerting\
**Created:** [August 30, 2021, 9:36am UTC](https://discuss.elastic.co/t/how-to-make-alerts-with-telegram-bot/282794 "2021-08-30T09:36:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sevenout](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@sevenout](https://discuss.elastic.co/u/sevenout)\
**Post date:** [August 30, 2021, 9:36am UTC](https://discuss.elastic.co/t/how-to-make-alerts-with-telegram-bot/282794/1 "2021-08-30T09:36:28Z")

</div>

hi guys, i'm learning Elasticsearch but i stumble in this problem. i want to send an alert from elastic to telegram.

In short this is the result that i expect:

> ![Untitled](https://us1.discourse-cdn.com/elastic/original/3X/8/f/8f8c3cc480ba9ea25553e9e27d5ee2259ad86945.png)

i use webhook connector and this is the config

> ![Untitled](https://us1.discourse-cdn.com/elastic/original/3X/0/a/0a5e63f55245e34f11347e660a3d34ea81a019ea.png)

but the problem is what should i put in this action body?

> ![Untitled](https://us1.discourse-cdn.com/elastic/original/3X/2/e/2ed54616500af9f327434c69fe8cad8808f29b78.png)

when i try to fill the body with the script above, this error appear. The connector can run just fine if i put just empty brackets

> ![Untitled](https://us1.discourse-cdn.com/elastic/original/3X/c/e/ce28e235e5dff53326bfeac0606992e63a570fe5.png)

but somehow i managed to send message with chat bot to telegram group using this url below, this url is the same with the url i use in connector config except i text parameter is removed

> [https://api.telegram.org/](https://api.telegram.org/)(bot token)/sendMessage?chat\_id=(chat id)&text=testText

Thanks

---

<div class="post-metadata">

**Author:** ![Aaron\_Caldwell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron_caldwell/32/45755_2.png) [@Aaron\_Caldwell](https://discuss.elastic.co/u/Aaron_Caldwell)\
**Post date:** [August 31, 2021, 10:48pm UTC](https://discuss.elastic.co/t/how-to-make-alerts-with-telegram-bot/282794/2 "2021-08-31T22:48:10Z")

</div>

Hello Martin,

I don't have any specific experience with connecting alerts with telegram bots, but I have used it with the webhook API interfacing with Slack. What I can tell you is that the structure of the keys portion of the JSON request made from Kibana is really dependent on what the receiving API expects. My best advice would be to review Telegram's docs and maybe see if they have a forum, discord, etc. for new devs. Once you've figured out the keys, then for the values you could start with some static values just to make sure things are working, then replace them with action variables (see [docs](https://www.elastic.co/guide/en/kibana/current/create-and-manage-rules.html#defining-rules-actions-details)).

Hope that helps!

Regards,  
Aaron

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 28, 2021, 10:49pm UTC](https://discuss.elastic.co/t/how-to-make-alerts-with-telegram-bot/282794/3 "2021-09-28T22:49:05Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
