BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Send Messages to Telegram with Webhook

#1

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

0 Likes

#2

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

0 Likes

#3

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

0 Likes

#4

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

Maybe your original sample should end with

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

0 Likes

#5

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

0 Likes

#6

Ive got it:

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

0 Likes

#7

Does it work from browser for you?

0 Likes

#8

Hello Dimitriy jey with my new format!

:slight_smile: Tanks for Help to all!

1 Like

#9

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

0 Likes

#10

@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.

0 Likes