Send Messages to Telegram with Webhook

Hey Guys,

i have tried to send Messages with the Blynk webhook and a Telegram Bot.
With Curl it is not a Problem but when i try to configure the url in Webhook i get an URL Malformed Error.

Here ist my URL (changed IDs):

https://api.telegram.org/botxxxxxxxxxxx123key/sendMessage?-d?chat_id=-23168065?-d?text=“This is a Test”

Can Someone Help me?

Greetings Zimb

It will probably be the text=“This is a Test” part.

Online url encoders convert that part to:

text%3D%22This+is+a+Test%22

Hello Costas,

i have tried it but doesnt Work.
https://api.telegram.org/bot272089:AAGrjUsUYLpyv3R3f0nHfG4WFMGA/sendMessage -d chat_id=154546328 -d text=“test123”
This format works in CURL

Try the urlencoder at http://www.url-encode-decode.com/

Maybe your original sample should end with

text%3D%22This+is+a+Test%22

Please show us URL you are trying to put in webhook widget. Above url doesn’t seem correct to me.

Ive got it:

https://api.telegram.org/bot2729:AArjUsUYLpyv0nHfG408PBXlWWFMGA/sendMessage?chat_id=122766328&text=/pin/

Does it work from browser for you?

Hello Dimitriy jey with my new format!

:slight_smile: Tanks for Help to all!

1 Like

Hi! So I got my telegram url working from my webbrowser, but not from webhooks-widget in the app… http://api.telegram.org/bot494291172:AAGV9fXVcuDSrfu_tB9MP1kkQWsI3Whlxxx/sendMessage?chat_id=-257978xxx&text=This is a test

I have some questions:

  1. Do I have to convert the whole thing or just parts of it with URL encoder?
  2. I want to send telegram message when D5 goes high, do I have to modify Nodemcu-program other than routing D5 to a virtual pin?
  3. Do the rest of the parameters in the Webhooks widget have to be set up in a certain way for it to work?

thanks,
Henrik

@jalapenos you put the wrong url into the webhook. Instead “http://api.telegram.org” you put " http%3A%2F%2Fapi.telegram.org%2F"

Parameters could be encoded, but not the schema (http://) part

Yeap.