# Dude Telegram notification example

**URL:** <https://forum.mikrotik.com/t/dude-telegram-notification-example/104998>\
**Category:** The Dude\
**Created:** [January 9, 2017, 8:59am UTC](https://forum.mikrotik.com/t/dude-telegram-notification-example/104998 "2017-01-09T08:59:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![PaulsMT](https://forum.mikrotik.com/letter_avatar/paulsmt/32/6_449c533f586939b6e5f246632a46421f.png) [@PaulsMT](https://forum.mikrotik.com/u/PaulsMT)\
**Post date:** [January 9, 2017, 8:59am UTC](https://forum.mikrotik.com/t/dude-telegram-notification-example/104998/1 "2017-01-09T08:59:48Z")

</div>

Currently it’s not possible to use HTTP POST method from Dude/RouterOS, so here is some workaround example how to use Telegram, to send messages using HTTP GET method:

[http://wiki.mikrotik.com/wiki/Manual:The\_Dude\_v6/Dude\_Telegram\_Example](http://wiki.mikrotik.com/wiki/Manual:The_Dude_v6/Dude_Telegram_Example)

Suggestions / requests will be appreciated.

---

<div class="post-metadata">

**Author:** ![turnip](https://forum.mikrotik.com/letter_avatar/turnip/32/6_449c533f586939b6e5f246632a46421f.png) [@turnip](https://forum.mikrotik.com/u/turnip)\
**Post date:** [January 10, 2017, 12:58am UTC](https://forum.mikrotik.com/t/dude-telegram-notification-example/104998/2 "2017-01-10T00:58:53Z")

</div>

That’s a great solution… I’m having trouble though - I can run the /tool fetch command from the command line and it works fine, but nothing happens when I run it from The Dude. I’ve tried pressing Test, and I’ve tried unplugging a router to see what happens, and the command never executes. Can’t see anything in the logs. Any ideas?

---

<div class="post-metadata">

**Author:** ![turnip](https://forum.mikrotik.com/letter_avatar/turnip/32/6_449c533f586939b6e5f246632a46421f.png) [@turnip](https://forum.mikrotik.com/u/turnip)\
**Post date:** [January 10, 2017, 2:23am UTC](https://forum.mikrotik.com/t/dude-telegram-notification-example/104998/3 "2017-01-10T02:23:54Z")

</div>

Never mind, just noticed this:  
Changes in v6.39rc7:

\*) Fixed - Tool fetch didn’t work with notification - execute on server

Upgrading now

---

<div class="post-metadata">

**Author:** ![sparker](https://forum.mikrotik.com/letter_avatar/sparker/32/6_449c533f586939b6e5f246632a46421f.png) [@sparker](https://forum.mikrotik.com/u/sparker)\
**Post date:** [January 18, 2017, 5:42am UTC](https://forum.mikrotik.com/t/dude-telegram-notification-example/104998/4 "2017-01-18T05:42:56Z")

</div>

> [@turnip](#):
>
> Never mind, just noticed this:  
> Changes in v6.39rc7:
> 
> \*) Fixed - Tool fetch didn’t work with notification - execute on server
> 
> Upgrading now

OR

```plaintext
:execute {/tool fetch url="https://api.telegram.org/botXXXXXX:AsG7sapGXDS1aHi_RllzgU9oJUm2wyKyHVw/sendMessage\?chat_id=1231231&text=[TimeAndDate] Service [Probe.Name] on [Device.Name] ([Device.CustomField1] - [Device.CustomField2]) is now [Service.Status] ([Service.ProblemDescription])" keep-result=no}

```

this option works for older versions

---

<div class="post-metadata">

**Author:** ![dricks](https://forum.mikrotik.com/letter_avatar/dricks/32/6_449c533f586939b6e5f246632a46421f.png) [@dricks](https://forum.mikrotik.com/u/dricks)\
**Post date:** [February 15, 2017, 6:21am UTC](https://forum.mikrotik.com/t/dude-telegram-notification-example/104998/5 "2017-02-15T06:21:19Z")

</div>

I configured all and is working!!!

Correct code for Version 6.38.1 - Please update de wiki

```plaintext
 /tool fetch url="https://api.telegram.org/botXXXXXXX:AAFZJtaHT_of7tV9IPEyK9R9XXXXFtk9_Ap-Pvk/sendMessage\?chat_id=XXXXXX&text=[TimeAndDate] Nodo: [Device.Name], Status: [Service.Status]" keep-result=no

```

Gretting

Pablo  
Sorry for my bad English

---

<div class="post-metadata">

**Author:** ![amt](https://forum.mikrotik.com/letter_avatar/amt/32/6_449c533f586939b6e5f246632a46421f.png) [@amt](https://forum.mikrotik.com/u/amt)\
**Post date:** [February 22, 2017, 11:44am UTC](https://forum.mikrotik.com/t/dude-telegram-notification-example/104998/6 "2017-02-22T11:44:07Z")

</div>

Hi,

what should be the chat\_id= ??

thanks

---

<div class="post-metadata">

**Author:** ![Shadeofspirit](https://forum.mikrotik.com/letter_avatar/shadeofspirit/32/6_449c533f586939b6e5f246632a46421f.png) [@Shadeofspirit](https://forum.mikrotik.com/u/Shadeofspirit)\
**Post date:** [February 22, 2017, 12:02pm UTC](https://forum.mikrotik.com/t/dude-telegram-notification-example/104998/7 "2017-02-22T12:02:46Z")

</div>

> [@amt](#):
>
> Hi,
> 
> what should be the chat\_id= ??
> 
> thanks

after creating the bot you can write to him. from browser you can see the id of this chat (you can use [https://api.telegram.org/botXXXXXXXXXXXXXXXXXX/getUpdates](https://api.telegram.org/botXXXXXXXXXXXXXXXXXX/getUpdates) )  
You should find “«chat»:{«id»:YYYYYYY”  
YYYYYYY - is your chat\_id

---

<div class="post-metadata">

**Author:** ![amt](https://forum.mikrotik.com/letter_avatar/amt/32/6_449c533f586939b6e5f246632a46421f.png) [@amt](https://forum.mikrotik.com/u/amt)\
**Post date:** [February 22, 2017, 1:35pm UTC](https://forum.mikrotik.com/t/dude-telegram-notification-example/104998/8 "2017-02-22T13:35:31Z")

</div>

thank you verymuch… its work. I would like to ask another question, is possible to do this on viber also ?

Thanks.

---

<div class="post-metadata">

**Author:** ![Shadeofspirit](https://forum.mikrotik.com/letter_avatar/shadeofspirit/32/6_449c533f586939b6e5f246632a46421f.png) [@Shadeofspirit](https://forum.mikrotik.com/u/Shadeofspirit)\
**Post date:** [February 23, 2017, 1:26pm UTC](https://forum.mikrotik.com/t/dude-telegram-notification-example/104998/9 "2017-02-23T13:26:28Z")

</div>

> [@amt](#):
>
> thank you verymuch… its work. I would like to ask another question, is possible to do this on viber also ?
> 
> Thanks.

yes you can. +37544five44340five

---

<div class="post-metadata">

**Author:** ![tamigi](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/tamigi/32/1826_2.png) [@tamigi](https://forum.mikrotik.com/u/tamigi)\
**Post date:** [February 27, 2017, 5:57pm UTC](https://forum.mikrotik.com/t/dude-telegram-notification-example/104998/10 "2017-02-27T17:57:11Z")

</div>

What’s the problem in settings .

![](http://uupload.ir/files/waro_88888888.jpg)

---

<div class="post-metadata">

**Author:** ![tomasi](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/tomasi/32/1431_2.png) [@tomasi](https://forum.mikrotik.com/u/tomasi)\
**Post date:** [March 1, 2017, 8:23pm UTC](https://forum.mikrotik.com/t/dude-telegram-notification-example/104998/11 "2017-03-01T20:23:43Z")

</div>

Hi,

I’ve tested the hyperlink, that it’s inside the fetch command:

```plaintext
https://api.telegram.org/bot123456789:AAQFb1byb3LEwMes_TQeCM1k5wsFb_VguhG/sendMessage\?chat_id=123456789&text=Hello

```

But It doesn’t even send the Hello message to the group the bot is participating.

The webpage says: “{“ok”:false,“error\_code”:404,“description”:“Not Found: method not found”}”

In Mikrotik terminal, it says: **failure: closing connection: \<400 Bad Request\> 149.154.167.200:443 (4)**

Am I doing something wrong? Do I need any additional step to allow the bot start a message?

Thanks! 😕

---

<div class="post-metadata">

**Author:** ![FlavioCamacho](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/flaviocamacho/32/1390_2.png) [@FlavioCamacho](https://forum.mikrotik.com/u/FlavioCamacho)\
**Post date:** [March 2, 2017, 12:53am UTC](https://forum.mikrotik.com/t/dude-telegram-notification-example/104998/12 "2017-03-02T00:53:25Z")

</div>

What do you think of adapting the dude to send messages through Whatsapp it is much more popular than the telegran.

---

<div class="post-metadata">

**Author:** ![amt](https://forum.mikrotik.com/letter_avatar/amt/32/6_449c533f586939b6e5f246632a46421f.png) [@amt](https://forum.mikrotik.com/u/amt)\
**Post date:** [March 2, 2017, 8:24am UTC](https://forum.mikrotik.com/t/dude-telegram-notification-example/104998/13 "2017-03-02T08:24:49Z")

</div>

> [@FlavioCamacho](#):
>
> What do you think of adapting the dude to send messages through Whatsapp it is much more popular than the telegran.

or viber…

---

<div class="post-metadata">

**Author:** ![soonwai](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/soonwai/32/1014_2.png) [@soonwai](https://forum.mikrotik.com/u/soonwai)\
**Post date:** [March 2, 2017, 4:28pm UTC](https://forum.mikrotik.com/t/dude-telegram-notification-example/104998/14 "2017-03-02T16:28:22Z")

</div>

> [@amt](#):
>
> or viber…

You can do the same with Viber. Use a Viber “Public Account”. I haven’t tried yet as it’s only available for selected countries.

Telegram is so far the easiest and most accessible.

---

<div class="post-metadata">

**Author:** ![irghost](https://forum.mikrotik.com/letter_avatar/irghost/32/6_449c533f586939b6e5f246632a46421f.png) [@irghost](https://forum.mikrotik.com/u/irghost)\
**Post date:** [March 2, 2017, 5:24pm UTC](https://forum.mikrotik.com/t/dude-telegram-notification-example/104998/15 "2017-03-02T17:24:17Z")

</div>

> [@tomasi](#):
>
> Hi,
> 
> I’ve tested the hyperlink, that it’s inside the fetch command:
> 
> ```plaintext
> https://api.telegram.org/bot123456789:AAQFb1byb3LEwMes_TQeCM1k5wsFb_VguhG/sendMessage\?chat_id=123456789&text=Hello
> 
> ```
> 
> But It doesn’t even send the Hello message to the group the bot is participating.
> 
> The webpage says: “{“ok”:false,“error\_code”:404,“description”:“Not Found: method not found”}”
> 
> In Mikrotik terminal, it says: **failure: closing connection: \<400 Bad Request\> 149.154.167.200:443 (4)**
> 
> Am I doing something wrong? Do I need any additional step to allow the bot start a message?
> 
> Thanks! 😕

```plaintext
/tool fetch url="https://api.telegram.org/botxxxxxxxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/sendmessage?chat_id=xxxxxx&text=Hi" keep-result=no

```

---

<div class="post-metadata">

**Author:** ![marnem](https://forum.mikrotik.com/letter_avatar/marnem/32/6_449c533f586939b6e5f246632a46421f.png) [@marnem](https://forum.mikrotik.com/u/marnem)\
**Post date:** [March 3, 2017, 4:13pm UTC](https://forum.mikrotik.com/t/dude-telegram-notification-example/104998/16 "2017-03-03T16:13:56Z")

</div>

```plaintext
/tool fetch url="https://api.telegram.org/bot<tokenbot>?chat_id=-1001099321185&text=[RECOVER] [TimeAndDate]; [Device.Name]: [Device.FirstAddress]; Status: [Service.Status] ([Service.ProblemDescription])" keep-result=no

```

for me this work… in my situation i’ve created a channel with other my coworker…this is a great solution for notification, very reactive!  
and then you can evolute your bot with some scripts, notification db ecc.ecc.  
great thing

---

<div class="post-metadata">

**Author:** ![vinu](https://forum.mikrotik.com/letter_avatar/vinu/32/6_449c533f586939b6e5f246632a46421f.png) [@vinu](https://forum.mikrotik.com/u/vinu)\
**Post date:** [April 23, 2017, 4:38pm UTC](https://forum.mikrotik.com/t/dude-telegram-notification-example/104998/17 "2017-04-23T16:38:38Z")

</div>

> [@tomasi](#):
>
> Hi,
> 
> I’ve tested the hyperlink, that it’s inside the fetch command:
> 
> ```plaintext
> https://api.telegram.org/bot123456789:AAQFb1byb3LEwMes_TQeCM1k5wsFb_VguhG/sendMessage\?chat_id=123456789&text=Hello
> 
> ```
> 
> But It doesn’t even send the Hello message to the group the bot is participating.
> 
> The webpage says: “{“ok”:false,“error\_code”:404,“description”:“Not Found: method not found”}”
> 
> In Mikrotik terminal, it says: **failure: closing connection: \<400 Bad Request\> 149.154.167.200:443 (4)**
> 
> Am I doing something wrong? Do I need any additional step to allow the bot start a message?
> 
> Thanks! 😕

HI  
issue fixed??

---

<div class="post-metadata">

**Author:** ![tomasi](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/tomasi/32/1431_2.png) [@tomasi](https://forum.mikrotik.com/u/tomasi)\
**Post date:** [April 25, 2017, 6:16pm UTC](https://forum.mikrotik.com/t/dude-telegram-notification-example/104998/18 "2017-04-25T18:16:05Z")

</div>

The issue was fixed, adding a minus sign before the chat ID:

before:

```plaintext
https://api.telegram.org/bot123456789:AAQFb1byb3LEwMes_TQeCM1k5wsFb_VguhG/sendMessage\?chat_id=123456789&text=Hello

```

after:

```plaintext
https://api.telegram.org/bot123456789:AAQFb1byb3LEwMes_TQeCM1k5wsFb_VguhG/sendMessage\?chat_id=-123456789&text=Hello

```

🙂

---

<div class="post-metadata">

**Author:** ![joca](https://forum.mikrotik.com/letter_avatar/joca/32/6_449c533f586939b6e5f246632a46421f.png) [@joca](https://forum.mikrotik.com/u/joca)\
**Post date:** [May 4, 2017, 12:25pm UTC](https://forum.mikrotik.com/t/dude-telegram-notification-example/104998/19 "2017-05-04T12:25:58Z")

</div>

> [@tomasi](#):
>
> The issue was fixed, adding a minus sign before the chat ID:
> 
> before:
> 
> ```plaintext
> https://api.telegram.org/bot123456789:AAQFb1byb3LEwMes_TQeCM1k5wsFb_VguhG/sendMessage\?chat_id=123456789&text=Hello
> 
> ```
> 
> after:
> 
> ```plaintext
> https://api.telegram.org/bot123456789:AAQFb1byb3LEwMes_TQeCM1k5wsFb_VguhG/sendMessage\?chat_id=-123456789&text=Hello
> 
> ```
> 
> 🙂

remove \ from “sendMessage?chat\_id=”

---

<div class="post-metadata">

**Author:** ![alisc](https://forum.mikrotik.com/letter_avatar/alisc/32/6_449c533f586939b6e5f246632a46421f.png) [@alisc](https://forum.mikrotik.com/u/alisc)\
**Post date:** [July 27, 2017, 4:29pm UTC](https://forum.mikrotik.com/t/dude-telegram-notification-example/104998/20 "2017-07-27T16:29:45Z")

</div>

hi  
how to send file ( backup file ) via Telegram ?

[Next page](https://forum.mikrotik.com/t/dude-telegram-notification-example/104998.md?page=2)
