HTTP SMS client is not working

Hamza2 years ago

Hi,

I am trying to add sms api in traccar but fail. Maybe I am not making the right code please check and let me know where I have gone wrong.

POST URL: http://siteurl.com/api/send.php?number=1xxxxxxx&type=text&message=test%20message&instance_id=63A8A5xxxxx&access_token=9bcde43cba3fe9xxxxxx

Url is working fine .

In JSON:

<entry key='notificator.types'>web,mail,sms,firebase</entry>
     <entry key='notificator.sms.manager.class'>org.traccar.sms.HttpSmsClient</entry>
        <entry key='sms.http.url'>http://siteurl.com/api/send.php?</entry>
            <entry key='sms.http.template'>{
    "number":"{phone}",
  "type":"text",
  "message":"{message}",
  "instance_id":"63A8Axxxx",
  "access_token":"9bcde43cba3fe97edb3ccxxxxxxxxxx"

}
</entry>

Code is not working

Anton Tananaev2 years ago

Does your API accept JSON?

Hamza2 years ago

maybe yes

Hamza2 years ago

Or what do I need to do if it doesn't supported.

Anton Tananaev2 years ago

You need to use the format that is supported.

Hamza2 years ago

POST URL: http://siteurl.com/api/send.php?number=1xxxxxxx&type=text&message=test%20message&instance_id=63A8A5xxxxx&access_token=9bcde43cba3fe9xxxxxx

Post url

Hamza2 years ago

Message sent successfully on OpenLink. But I don't understand how to implement in traccar.

Hamza2 years ago

Api Doc

Image Link : https://ibb.co/5n46PC9

Anton Tananaev2 years ago

We do not support query parameters.