Telegram notifications not sent

gonza_cid5 years ago

@Jose B, can you send a message from a curl or from a browser?
curl -s -X POST https://api.telegram.org/bot<TOKEN>/sendMessage -d chat_id=<API_CHAT_ID> -d text="Hello World"
or
https://api.telegram.org/bot<MY_TOKEN>/sendMessage?chat_id=<API_CHAT_ID>&text="Hello World"

EDIT:
I have read now than yes, but I don't know about phone number, this call uses chatid not phone number. Now I'm using traccar 4.5 and it works with the params (pay attention to upper/lower cases)

    <entry key='notificator.types'>web,mail,telegram</entry>
    <entry key='notificator.telegram.key'>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</entry>
    <entry key='notificator.telegram.chatId'>nnnnnn</entry>
Jose B5 years ago

@GoNzCiD, now works for me. the problem was the params that changes André
https://www.traccar.org/documentation/notifications/ are not updated .

JB

gonza_cid5 years ago

OK, I read it from github code. In 4.4 the camelCase was wrong

Parth5 years ago

Hello Anton,

I have updated my traccar to 4.5 and telegram notification is not working event after successful configuration.

Below is my configuration:

    <entry key='notificator.types'>web,mail,firebase,sms,telegram</entry>
    <entry key='notificator.telegram.key'>TOKEN</entry>
    <entry key='notificator.telegram.chatid'>API_CHAT_ID</entry>

And the traccar is giving the error as,

WARN: Telegram API error - HTTP 400 Bad Request - BadRequestException (...)

I have tested the key and chatID is working fine with:

curl -s -X POST https://api.telegram.org/bot<TOKEN>/sendMessage -d chat_id=<API_CHAT_ID> -d text="Hello World"

Can you please help in this regards?

Thanks in advance.

Parth5 years ago

Hello Anton,

Can you please help me in this issue ?

Regards.

Alex T4 years ago

I quit to make telegram notificator work...

But telegram still work fine with sms notificator:

    <entry key='notificator.types'>web,mail,sms</entry>
    <entry key='notificator.sms.manager.class'>org.traccar.sms.HttpSmsClient</entry>
    <entry key='sms.http.url'>https://api.telegram.org/botSEU-TOKEN-AQUI/sendMessage?</entry>
    <entry key='sms.http.user'>[YOUR ACCOUNT SID]</entry>
    <entry key='sms.http.password'>[YOUR AUTH TOKEN]</entry>
    <entry key='sms.http.template'>
        chat_id={phone}&amp;text={message}
    </entry>