Dude Telegram notification example

I tried this with RouterOS and I receive the messages on telegram, but not the time, device name and status, maybe because in RouterOS its difrent from Dude, is there any chance to get this working also on RouterOS?

I have automated backups and also like the option to send send via telegram, automated or via command in telegram.

Thanks.

I already tried so send the file with the two following commands, but get the error code 404, I think the URL is wrong, no ones knows how to send the backup file to telegram?

/tool fetch url="https://api.telegram.org/bot/sendphoto?chat_id=&photo=today.backup” keep-result=no

/tool fetch url="https://api.telegram.org/bot/sendDocument?chat_id=&document=today.backup” keep-result=no

Thanks.

Hi all!

May be it is offtopic, but i am using telegram notifications from my CCR (not Dude) whrough this URL:
/tool fetch url=“https://api.telegram.org/bot/sendMessage?chat_id=<ChatId with “-”>&text=Very_Impotant_Tunnel_Up”

Also, I wrote an article about this, but it is on russian…
https://www.1spla.ru/blog/telegram_bot_for_mikrotik

That script will work with NetWacht?

How to call admin number ?

Do you have a solution to call admins when it event?

Yes.. you can use it at netwatch

I have followed the instructions but it doesn´t work. To see what´s happening i tried the fetch command on the command line but i always receive the following error:

[admin@Dude_x86] > /tool fetch url="https://api.telegram.org/bot<TOKEN_BOT>\?chat_id=348399094&text=HelloWorld!" keep-result=no
  status: failed

failure: closing connection: <502 Bad Gateway> 149.154.167.200:443 (4)

Any ideas ???

it looks like you had made a mistake in token)

the command to send is:
/tool fetch url=“https://api.telegram.org/botXXXXX:YYYYY/sendMessage?chat_id=ZZZZZ&text=Hello World” keep-result=no
where XXXXX is your bot id
YYYYY bot token
ZZZZZ chat id

the command to send is:
/tool fetch url=“> https://api.telegram.org/botXXXXX:YYYYY/sendMessage?chat_id=ZZZZZ&text=Hello > World” keep-result=no
where XXXXX is your bot id
YYYYY bot token
ZZZZZ chat id

Sorry man, i didn´t write it right on the last post, but that´s exactly what i typed… I was calling token the entire <BOT_ID>:<BOT_TOKEN> … my mistake. I created the bot using botfather and followed the tutorial, i still got the 502 bad gateway error.

/tool fetch url="https://api.telegram.org/bot<BOT_ID>:<BOT_TOKEN>\?chat_id=348399094&text=Hello World !" keep-result=no

What am i doing wrong ?

first of all:
/sendMessage? before chat_id
the second is, that you can use it in script (create test scrip with only command to send message), because from command line on mikrotik it wouldn’t work

first of all:
/sendMessage? before chat_id
the second is, that you can use it in script (create test scrip with only command to send message), because from command line on mikrotik it wouldn’t work

So the line should look like this ?

/tool fetch url="https://api.telegram.org/bot<BOT_ID>:<BOT_TOKEN>/sendMessage?=Hello World\?chat_id=348399094" keep-result=no

no, as i had posted:
/tool fetch url="https://api.telegram.org/bot**XXXXX:YYYYY**/sendMessage?chat_id=**ZZZZZ**&text=**Hello World" keep-result=no**

Well, i tried as you said and now i receive a 404 not found error message. Now i´m posting my bot ID and TOKEN.

[admin@Dude_x86] > /tool fetch url="https://api.telegram.org/bot<BOT_ID>:<BOT_TOKEN=Hello World" keep-result=no
  status: failed

failure: closing connection: <404 Not Found> 149.154.167.198:443 (4)

When i type the URL https://api.telegram.org/bot<BOT_ID>:<BOT_TOKEN/getme on the browser followed by the "getme " i got the following statement

{"ok":true,"result":{"id":BOT_ID,"is_bot":true,"first_name":"xxxx","username":"xxxxxxx"}}

What am i missing here ?

Please, write there if you get message in telegram.
If you get - all is correct in your config.
read my previous message - this command can be used in script, but not in command line

Shadeofspirit, i receive your message. Thanks for the help man, i´ll try it on a script as you said.

I worked !!! Thanks for the help Shade !

if you want, i can send you script that i used for sending message by skype, telegram, viber, e-mail
and i suggest you to delete your message on forum with your bot token

Yes, could you send me please ? you can post it here on the forum or by gmail if you prefer

benjamim.gois@gmail.com

Hi hi, team.
I’m stuck on same problem, or similar to this one.
When i test dude notification all working ok, but when some switch in dude lost , the chat bot is silent.
And i dont know where can be the mistake, because all is working but bot in the chat sleeping :slight_smile:
Any information needed ?