Page 1 of 1

Telegram notification

Posted: Mon Jun 22, 2020 9:01 am
by JKQ
Hello. I have long wanted to make notifications via Telegram. Finally Telegram was unlocked in Russia and I decided to try it.

For the test, I created a task in the scheduler, but the notification does not come.
/tool fetch url=”https://api.telegram.org/botХХХХХХХХХХХХХХ/sendMessage?chat_id=-XXXXX&text=test in "
When I run the command in the terminal, then messages are sent.
/tool fetch url=”https://api.telegram.org/botХХХХХХХХХХХХХХ/sendMessage\?chat_id=-XXXXX&text=test in terminalt"
Tell me what could be the problem (RouterOS v6.41.1)?
Maybe the problem is in the firewall? But I have no rules in the output chain.

Re: Telegram notification

Posted: Tue Jun 23, 2020 2:56 pm
by eworm
Possibly missing the escape for question mark?

Re: Telegram notification

Posted: Tue Jun 23, 2020 4:31 pm
by Sarel0092
I use the following to send notifications via Telegram in a script:
/tool fetch url="https://api.telegram.org/botxxxxxxxx/sendMessage\?chat_id=-xxxx&text=Test" keep-result=no;
Edit:
Used with version 6.46.6.

Re: how to send Notifications via Pushover & Pushbullet

Posted: Sat Jul 18, 2020 9:43 pm
by knedlyk
You may also use Pushbullet:

/tool fetch mode=https url="https://api.pushbullet.com/v2/pushes " http-method=post http-data="type=note&body=some text" user="API-Token"

On a specific device:

/tool fetch mode=https url="https://api.pushbullet.com/v2/pushes" http-method=post http-data="device_iden=<device_id>&type=note&body=some text" user="API-Token"