SMS API

Dave4 years ago

Murthy Varanasi,
Have you contacted your service provider at MSG91?
I have trawled their API documentation and can only see that I would need to create an account and they would help me with using their API.
My initial thought is that you need to lose the brackets, then perhaps you may have too many "x"'s in your config. I do get that you have masked your authkey. :-)

Perhaps try:

<entry key='sms.http.template'>
        route=x&amp;sender=x&amp;country=91&amp;mobiles={phone}&amp;message={message}&amp;authkey=xxxx
</entry>

Don't forget, you need to reboot your traccar server each time you make updates to the "traccar.xml" file!

Dave4 years ago

Murthy Varanasi,

My initial thought is that you need to lose the brackets, then perhaps you may have too many "x"'s in your config. I do get that you have masked your authkey. :-)

Perhaps try:

<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.msg91.com/api/sendhttp.php</entry>
<entry key='sms.http.template'>
        route=xx&amp;sender=xxxxx&amp;country=91&amp;mobiles={phone}&amp;message={message}&amp;authkey=xxxx
</entry>

Don't forget, you need to reboot your traccar server each time you make updates to the "traccar.xml" file!

Murthy Varanasi4 years ago

Thanks for the reply. It worked out. Ha before posting it I removed it and tried. It solved. It worked

Dave4 years ago

Cool.
Would you like to share your solution with the class please.
It will help anyone else using MSG91 as their service provider.

Murthy Varanasi4 years ago
 <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.msg91.com/api/sendhttp.php?</entry>


<entry key='sms.http.template'>
route=4&amp;sender=[senderid]&amp;country=[country code]&amp;mobiles={phone}&amp;message={message}&amp;authkey=[auth key]
</entry>