Exemple utilizare API sms kendalo.ro
Verificare credit
<?php
$url = "https://sms.kendalo.ro/api.php";
$data["api_user"]="adresa de email din contul sms.kendalo.ro";
$data["api_key"]="api key din sms.kendalo.ro, https://sms.kendalo.ro/contulmeu.php";
$data["comanda"]="verifica_credit";
$options = array(
"http" => array(
"header" => "Content-type: application/x-www-form-urlencoded\r\n",
"method" => "POST",
"content" => http_build_query($data),
),
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) { echo "eroare api sms"; }
echo "\n--------------------------\n";
print_r($result);
echo "\n--------------------------\n";
?>
Trimite SMS
<?php
$url = "https://sms.kendalo.ro/api.php";
$data["api_user"]="adresa de email din contul sms.kendalo.ro";
$data["api_key"]="api key din sms.kendalo.ro, https://sms.kendalo.ro/contulmeu.php";
$data["id_campanie"] = 1337;
$data["comanda"]="trimite_sms";
$data["nr"] = "07XXXXXXXX";
$data["mesaj"] = "mesaj test sms.kendalo.ro";
$options = array(
"http" => array(
"header" => "Content-type: application/x-www-form-urlencoded\r\n",
"method" => "POST",
"content" => http_build_query($data),
),
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) { echo "eroare api sms"; }
echo "\n--------------------------\n";
print_r($result);
echo "\n--------------------------\n";
?>
Verifica Status SMS
<?php
$url = "https://sms.kendalo.ro/api.php";
$data["api_user"]="adresa de email din contul sms.kendalo.ro";
$data["api_key"]="api key din sms.kendalo.ro, https://sms.kendalo.ro/contulmeu.php";
$data["comanda"]="verifica_status_sms";
$data["id_mesaj"] = "valoare numerica obtinuta la expedierea mesajului";
$options = array(
"http" => array(
"header" => "Content-type: application/x-www-form-urlencoded\r\n",
"method" => "POST",
"content" => http_build_query($data),
),
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) { echo "eroare api sms"; }
echo "\n--------------------------\n";
$result = json_decode($result,true);
print_r($result);
echo "\n--------------------------\n";
?>
Creare campanie
<?php
$url = "https://sms.kendalo.ro/api.php";
$data["api_user"]="adresa de email din contul sms.kendalo.ro";
$data["api_key"]="api key din sms.kendalo.ro, https://sms.kendalo.ro/contulmeu.php";
$data["comanda"]="creare_campanie";
$data["nume_campanie"] = "Nume Campanie Unic";
$options = array(
"http" => array(
"header" => "Content-type: application/x-www-form-urlencoded\r\n",
"method" => "POST",
"content" => http_build_query($data),
),
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) { echo "eroare api sms"; }
echo "\n--------------------------\n";
$result = json_decode($result,true);
print_r($result);
echo "\n--------------------------\n";
?>