Watcher webhook send message to telegram bot issue

Hi,

I wrote a watcher which send a message (via Webhook) to my twitterbot.

Let start with my config:

"actions": {
    "my_webhook": {
      "webhook": {
        "scheme": "https",
        "host": "api.telegram.org/bot{number}/sendMessage?chat_id={number}&disable_web_page_preview=1&parse_mode=Markdown&text=test",
        "port": 443,
        "method": "GET"
      }
    }
  }

I put not only the domainname (api.telegram.org) of the twitterbot in the "host" field but also the full path behind it. Otherwise it won't work for me. So like this:
api.telegram.org/bot{number}/sendMessage?chat_id={number}&disable_web_page_preview=1&parse_mode=Markdown&text=test"

The problem is that the port field value will be put in the url after the domain.
So like this:
api.telegram.org:443/bot{number}/sendMessage?chat_id={number}&disable_web_page_preview=1&parse_mode=Markdown&text=test"

Is it possible to filter out the port field in the url?
Or should I use an other method?

Best regards,
Robin

hey,

host is only the hostname without the path or the parameters. If you want to use mustache parameters, you need to use the path variable.

See https://www.elastic.co/guide/en/elasticsearch/reference/7.6/actions-webhook.html

--Alex

Hi Alex,

That won't work because my url will be parsed into an invalid url:
api.telegram.org:443/bot{number}/sendMessage?chat_id={number}&disable_web_page_preview=1&parse_mode=Markdown&text=test"

The portnumber should be added at the end.