"Free mobile" french provider and sending SMS through his SMS HTTP API

xav lec6 years ago

Hello,
My GSM provider is Free Mobile and they offer a HTTP API to send SMS.

The format of a working URL through this API : https://smsapi.free-mobile.fr/sendmsg?user=12345678&pass=oiygazfpigiugfz&msg=Hello%20World%20!
Where :
user=[account number]
pass=[API key]
msg= [the message to send]

Does Traccar supports the "https" method to send SMS through API ?
Can someone help me to adapt this syntax to the Traccar configuration file ?

There are some examples given in the documentation but no one seems to correspond to my syntax :
https://www.traccar.org/http-sms-api/

Thanks

Anton Tananaev6 years ago

If it supports regular POST method with parameters in the body, it should be possible to configure in Traccar.

xav lec6 years ago

Yes, it seems to support the post method.
But there is no documentation on my provider side on how to use the post method.

Any advice ?

xav lec6 years ago

Tried the following conf :

<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://smsapi.free-mobile.fr/sendmsg</entry>
<entry key='sms.http.user'>#####</entry>
<entry key='sms.http.password'>#####</entry>
<entry key='sms.http.template'>
From=#####&amp;To={phone}&amp;Body={message}
</entry>

But I obtain the following error when testing :

MessageException (HttpSmsClient:91 < NotificatorSms:57 < NotificationResource:63 < ...)

Any idea ?

Anton Tananaev6 years ago

Most likely it means that your provider returned non 200 HTTP response, which means error.