eSMSapi gateway integrated help

JD2 years ago

This is esmsapi.com Api they just give us in PHP and python but we can't understand how we can convert it to traccar format I have tested it with PHP it working fine

<?php

  $message = [
      "secret" => "2132819115a436ba940ac088e4d13df525e813e4", // your API secret from (Tools -> API Keys) page
      "mode" => "devices",
      "device" => "00000000-0000-0000-564a-9da69378e695",
      "sim" => 1,
      "priority" => 2,
      "phone" => "+923167290099",
      "message" => "Hello World!"
  ];

  $cURL = curl_init("https://esmsapi.com/api/send/sms");
  curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($cURL, CURLOPT_POSTFIELDS, $message);
  $response = curl_exec($cURL);
  curl_close($cURL);

  $result = json_decode($response, true);

  // do something with the response
  print_r($result);
Anton Tananaev2 years ago

Something like this should work:

<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://esmsapi.com/api/send/sms</entry>
<entry key='sms.http.template'>
secret=YOUR_KEY&amp;mode=devices&amp;device=DEVICE_ID&amp;sim=1&amp;priority=2&amp;phone={phone}&amp;message={message}
</entry>
JD2 years ago

wow...! it's working fine...! now I will connect multiple android mobiles with traccar Thanks for your great support