doubts with telegram

Marcelo Rangel 6 years ago

this code sends by telegram but the sending method is SMS

Macan 6 years ago

So if I understand you good Marcelo this option is free , no cost for sending SMS with this method ?
If that is true then this option is so great my friend.

Regards

Marcelo Rangel 6 years ago

Yes .. This code sends messages via telegram but the sending method is SMS and works on all versions of traccar

Macan 6 years ago

Marcelo you are genius , that is so great, thank you for sharing this information, I am on trip now but I will try to implement it tommorow.

Thank you again.

Regards

Marcelo Rangel 6 years ago

This code sends messages via telegram but the sending method is SMS and works on all versions of traccar it wasn't me who created the code i don't know whose authorship but it works perfectly

Marcelo Rangel 6 years ago

in the user phone field you enter the bot code

Macan 6 years ago

Marcelo, bot code , you mean bot username or something else ?

Marcelo Rangel 6 years ago
Macan 6 years ago

Ok , can you please Marcelo if you have a time explain me is this ok:

I get the HTTP API token via BotFather on Telegram , it is something like this , in this format:
999999:kSksSKsKSksSKskSksKSsk-CK888dDd

where 999999 is the user id, and i got chatID, something like this: 888888.
So that bot chat ID i add on the user phone field just like you explain in the picture, correct ?

Format in the config file will look like this, is this correct :

<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'>999999</entry>
<entry key='sms.http.password'>kSksSKsKSksSKskSksKSsk-CK888dDd</entry>
 <entry key='sms.http.template'>
  chat_id={phone}&amp;text={message}</entry>

Correct me please ?

Regards

Jose B 6 years ago

Hi Marcelo,

I didn´t understand how get the http-token, http-user and http-password to fill <entry key='sms.http.url'>, <entry key='sms.http.user'> and <entry key='sms.http.password>. how get it from botftather?

JB

Marcelo Rangel 6 years ago

in this code replace only your token and do not touch anything else and it sure will work

<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/bot999999:kSksSKsKSksSKskSksKSsk-CK888dDd/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>
Jose B 6 years ago

Pls, where I get [YOUR ACCOUNT SID] and [YOUR AUTH TOKEN]?

Macan 6 years ago

Marcelo my friend thank you, but unfortunately when I add that code in my config file, I can not start my traccar server , I am getting the error message:
Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

I am sure the methods work and I like it but I can not find a solution for my problem to use that great method. Thank you again.

and Jose B here is the tutorial step y step : https://www.traccar.org/forums/topic/how-to-integrate-telegram-into-traccar-45/

Macan 6 years ago

I fixed it and I get messages via Telegram using this method.

Jose B 6 years ago

Thank you for indication, but I already integrated traccar 4.5 with telegram. I am interested in use the SMS by Telegram.
Could you help me to configure 'sms.http.user' and 'sms.http.password'.