doubts with telegram

Marcelo Rangel5 years ago

this code sends by telegram but the sending method is SMS

Macan5 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 Rangel5 years ago

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

Macan5 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 Rangel5 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 Rangel5 years ago

in the user phone field you enter the bot code

Macan5 years ago

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

Marcelo Rangel5 years ago
Macan5 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 B5 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 Rangel5 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 B5 years ago

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

Macan5 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/

Macan5 years ago

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

Jose B5 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'.