HTTP SMS client is not working

Hamzaa year 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 Tananaeva year ago

Does your API accept JSON?

Hamzaa year ago

maybe yes

Hamzaa year ago

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

Anton Tananaeva year ago

You need to use the format that is supported.

Hamzaa year ago

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

Post url

Hamzaa year ago

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

Hamzaa year ago

Api Doc

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

Anton Tananaeva year ago

We do not support query parameters.