Twilio SMS / Whatsapp

simplementese6 days ago

Dear Sirs, I am trying to implement the operation of Whatsapp with Traccar.

I am using the Twilio Server, I configured the system for SMS and it worked without problems.

Regarding Whatsapp, I enabled it, configured the Sandbox and added my phone number to the list.-

With the following configuration Traccar does not give me any error..

cfg tra.jpg

The Message arrives at Twilio but it does not come out due to the following error

error.png

error: 63027 : Template does not exist for a language and locale

I checked the traccar forums and the Twilio documentation, and although it talks about a general error, I understand that it should take the template as for SMS. -

I don't know if someone implemented it correctly, I saw in the photo that yes.

Thanks!

simplementese6 days ago

As seen in the Twilio panel .-

The FROM and TO are interpreted correctly

Also the body of the message in this case a Traccar Test message, which arrives correctly to the Twilio server

mensaje.jpg

SwayDev5 days ago

This is not a Traccar problem

Check with your recipient countries restrictions and Twilio's 'approved template' requirements !

Twilio may be requiring you to submit a template for approval, before sending Text using that template/format.

Sandbox & Testing with own number may not return these errors!

simplementese5 days ago

I understood that it might not be from Traccar but it is related and I thought it could be useful.-

The SMS worked without problems.

Exactly for Whatsapp you need to create a template with the alert format and in the corresponding language. The Alerts arrive Perfect.

In the first Post there is the configuration for Traccar which works OK.

I leave this because there are many messages in the forum with configurations that do not work

SwayDev5 days ago

Your post concluded with a question, asking if someone else has implemented it correctly ! then you shared screenshots of errors and the error message from Twilio in both posts!

This is a public forum where people take time out to help each other.

Based on your post (a question) when someone tries to help, do not respond back with a condescending approach please.

That being said, as a general expectation if you are actually trying to post something that is with intention to help others please ensure to include information that can actually be helpful to others.

e.g.

  1. The problem
  2. The expected result
  3. The solution (Fix, or how the problem can be resolved)
simplementese5 days ago

I think you're being too startled and that's what Anton or the mod is for.

Initially it was a question due to a problem.

Which I edited and updated.

I think the only thing that isn't useful is your post.

Since as I said there is configuration data that is useful and it isn't in the forum. As Anton says, we should always search before consulting.

Track-trace5 days ago

@simplementese

Well, being helpfull on the forum you should actually post the detailed solution if you found one.

simplementese5 days ago

st.

You are asking me for things that are not true, thousands of posts, there is not a single detailed solution as an answer.

In fact, not even a correct xml traccar configuration for whatsapp with twilio.
Here I left a screenshot that can be useful to many who search like me and did not find it.

But if not, Anton should delete the post.

Track-trace5 days ago

Well if you actually dont want to share the detailed solution that made it work for you after asking for help here, you can expect others to ignore your posts in the future when you are asking for help.

Anton Tananaev5 days ago

People don't have to post anything, but of course posting solution details is appreciated.

simplementese5 days ago

Clearly Anton, my comment was due to their bad manners, when they did not contribute anything.

After many attempts I managed to find the correct configuration file which I attached the image, and it is the configuration in traccar that makes Twilio's Whatsapp work

See Configuration Image in the first post.

Then obviously with the Twilio account created, you have to activate the sandbox, enable Whatsapp, and I will explain what I was initially missing, create the Templates in twilio in the correct language with the body of the traccar message

Example

Ejemplo de valores de prueba:

Tracking Alert: Your vehicle {{1}} has triggered an alert for {{2}} in {{3}}. Check its location here: {{4}}

{{1}} → Auto ABC
{{2}} → velocidad excesiva
{{3}} → Av. 9 de julio
{{4}} → https://maps.google.com/?q=-34.603722,-58.381592

Byron a day ago

traccar whatsapp.png

hi sorry to jump on your post, i was also able to get to this point i have a number already registered to WhatsApp api, you need to do that after using their sandbox, i can send messages using post using the variables for the template, but cant figure out how to make the regular notifications and the need of a template to work, example:
if i go to: /opt/traccar/templates1/short/alarm.vm
i can edit example the template for powerCut

$device.name Alarma de: #{if}($position.getString("alarm").equals("powerCut"))DESCONEXION DE BATERIA

which in results gives me the following push notification

HYUNDAI TUCSON Alarma de: DESCONEXION DE BATERIA powerCut  Verifique de inmediato o contacte a EcuaGPS al 099-999-9999.

if i use twillio to send this i must edit this template to instead send

{"1":"KIA SPORTAGE ABN-6829","2":"2024-12-20 06:48:04"}

which in results using the approved twillio whatsapp template translates the message and sends this message to the client.

KIA SPORTAGE ABN-6829 Alarma de:  Desconexión de batería activada. 2024-12-20 06:48:04 Verifique de inmediato o contacte a EcuaGPS al 099-999-9999.

the problem i want to solve is how do i keep my original template for push notification and also when this same powerCut alarm is activated send a different message trough the other channel

Alert power cut but send use a different template depending on the channel to be used sms/firebase

"$device.name Alarma de: #{if}($position.getString("alarm").equals("powerCut"))DESCONEXION DE BATERIA" 

because this will send and show correctly in push notification

and also send this over the api to twillio

"{"1":"KIA SPORTAGE ABN-6829","2":"2024-12-20 06:48:04"}"