API -> Αποστολή SMS

Περιγραφή

Χρησιμοποιείστε την συγκεκριμένη υπηρεσία για να στείλετε SMS σε παραλήπτες

Endpoint

POST https://api.v-track.gr/webapi_v1/json.php?f=sms_send

Authentication

Απαιτούνται τα παρακάτω headers:

Header Περιγραφή
X-Public Το username που σας έχει δοθεί από το dashboard
Authorization Bearer

Τα διαπιστευτήρια εκδίδονται από: https://dashboard.v-track.gr

Παράδειγμα Request


$url = "https://api.v-track.gr/sms/send_sms/json.php?f=send_sms";
$username = "";
$api_key = "";

$setData = array();
$setData["number"] = "6900000000";
$setData["message"] = "This is a test message";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($setData) );
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($ch, CURLOPT_TIMEOUT, 360);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'X-Public: ' . $username,
"authorization: Bearer ".$api_key
));

curl_exec($ch);
curl_close($ch);

Παράδειγμα Response

Επιτυχής

{"success":1,"reference":"00d9ade1-bf29-479e-b8c0-189b4b3c3716"}

Σφάλμα

{"errno":1000,"error":"Invalid Credential"}