Use Twilio Whatsapp msg service

lRoberth4 years ago

I've tried following several instructions in these same forums, but I just can't get it to work.
I want to use Twilio Whatsapp service instead normal SMS.
Whatsapp message does work perfectly through Curl, but just can't get it to work with Traccar.
This is my CURL (running it from cmd.exe)

C:\Users\Mr.lRoberth.->curl "https://api.twilio.com/2010-04-01/Accounts/XXXXXXXXXXX/Messages.json" -X POST --data-urlencode "To=whatsapp:+XXXXXXXXXXXX" --data-urlencode "From=whatsapp:+XXXXXXXXXXXX" --data-urlencode "Body=Test msg" -u XXXXXXXXXXXX:XXXXXXXXXXXX

Response:
{"sid": "SMdc000509bf43406d83219eacb07d408b", "date_created": "Mon, 14 Jun 2021 03:47:53 +0000", "date_updated": "Mon, 14 Jun 2021 03:47:53 +0000", "date_sent": null, "account_sid": "XXXXXXXXXX", "to": "whatsapp:+XXXXXXXXXX", "from": "whatsapp:+XXXXXXXXXXXX", "messaging_service_sid": null, "body": "Test msg", "status": "queued", "num_segments": "1", "num_media": "0", "direction": "outbound-api", "api_version": "2010-04-01", "price": null, "price_unit": null, "error_code": null, "error_message": null, "uri": "/2010-04-01/Accounts/XXXXXXXXXXXXXX/Messages/SMdc000509bf43406d83219eacb07d408b.json", "subresource_uris": {"media": "/2010-04-01/Accounts/XXXXXXXXXXXXXXXXX/Messages/SMdc000509bf43406d83219eacb07d408b/Media.json"}}

Now, this is my Traccar config:

<entry key='notificator.sms.manager.class'>org.traccar.sms.HttpSmsClient</entry>
<entry key='sms.http.url'>https://api.twilio.com/2010-04-01/Accounts/************/Messages.json</entry>
<entry key='sms.http.user'>***********</entry>
<entry key='sms.http.password'>***********</entry>
<entry key='sms.http.template'>
        From=whatsapp:%2B**********&amp;To=whatsapp:{phone}&amp;Body={message}
</entry>

For some reason I don't get the message, there's no error or warning messages in tracker-server.logs
Any idea how to get this sorted out?