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! Go to Solution.
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:
Url:
https://api.telegram.org/bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/sendMessage
Body:
{
"chat_id":yourchatid,
"text":"<<CONCATENATE(
"Your",
" text",
" here"
)>>",
"parse_mode":"MarkdownV2"
}
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"
}
User | Count |
---|---|
17 | |
14 | |
8 | |
7 | |
4 |