Webhoook with telegram

I need help to try call a webhook:

- I try it to add this url: "https://api.telegram.org/bot{my token}
/sendMessage?chat_id={my id chat}&text="&CONCATENATE("Hi", " this is a text")

but appear Error 1 : The webhook url .............. is not well formed!

 

So what is the correct form to use with telegram api?

 

Thanks you. 

Solved Solved
0 10 2,782
2 ACCEPTED SOLUTIONS

May be related to the fact that it's not encoded since you are adding the message on the URL.
https://help.appsheet.com/en/articles/2347653-encodeurl

 

https://api.telegram.org/bot{my token}/sendMessage?chat_id={my id chat}&text=<<ENCODEURL(CONCATENATE("Hi", " this is a text"))>>

 

I do it this way though:

SkrOYC_1-1644273143872.png

Url

https://api.telegram.org/bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/sendMessage

 Body:

 

{
"chat_id":yourchatid,
"text":"<<CONCATENATE(
"Your",
" text",
" here"
)>>",
"parse_mode":"MarkdownV2"
}

 

 

View solution in original post

Well, guess what? I tried it again today with the line break stuff and it worked.

This is counterintuitive so make sure you follow me.

Everytime you want to make a line break it has to be outside of your text.

On this example:

{
"chat_id":yourchatid,
"text":"<<CONCATENATE(
"Your",
" text",
" here"
)>>",
"parse_mode":"MarkdownV2"
}

 

You would think that the line break should be inside your text, like this:

 

{
"chat_id":yourchatid,
"text":"<<CONCATENATE(
"Your",
" text",
" here",
"\nNew line"
)>>",
"parse_mode":"MarkdownV2"
}

 

It won't work. The thing is, you have to make a big mess to make sure every line break is where you want it.

If you want something like this on Telegram:


Hi UserName!
Today is Feb 8, 2022
You have X pending tasks to do

You need something like this on your Body:

 

{
"chat_id":yourchatid,
"text":"<<CONCATENATE( "Hi *", [ColumnWithUserName]), "*")>>\n
<<CONCATENATE("Today is ", TEXT(TODAY(), MMM DD, YYYY))>>\n
<<CONCATENATE( "You have ", [AnyColumnOrExpressionCountingThis], " pending task to do")>>",
"parse_mode":"MarkdownV2"
}

 

Basically, make sure the \n is outside any function/expression (it's not part of your text). It should be between the expressions, out of the <<>>

In other words, every line should be it's own expression

View solution in original post

10 REPLIES 10