Pricing plans  Services  API  Partners  About the service  Contacts 
8 (800) 700 7672
Free in Russia
 

Integration with the service (API)

The API allows you to send messages through your projects and services over HTTP/HTTPS, SMTP and SMPP protocols. Ready-made libraries in different programming languages connect to your project and help you send messages from anywhere with a single command. For simplified authorization, instead of a login and password pair, you can use a special API key.


HTTP/HTTPS SMTP SMPP SOAP OMS SMS Commands Libraries and code examples

SOAP Protocol

<?
// Отправка сообщения

$client = new SoapClient ("http://smscentre.com/sys/soap.php?wsdl");
$ret = $client->send_sms(array("login"=>"alex", "psw"=>"123", "phones"=>"79999999999", "mes"=>"Hello world!", "id"=>"", "sender"=>"ivan", "time"=>0));

if (
$ret->sendresult->error)
    echo
"Ошибка №".$ret->sendresult->error;
else {
    echo
$ret->sendresult->id, "\n";
    echo
$ret->sendresult->balance, "\n";
    echo
$ret->sendresult->cost, "\n";
    echo
$ret->sendresult->cnt, "\n";
}


//Flash сообщение от отправителя "ivan", которое должно быть доставлено абоненту 01.01.2012 г. в 00:00:

$ret = $client->send_sms2(array("login"=>"alex", "psw"=>"123", "phones"=>"79999999999", "mes"=>"Hello world!", "id"=>"", "sender"=>"ivan", "time"=>"0101120000", "query"=>"flash=1"));

if (
$ret->sendresult->error)
    echo
"Ошибка №".$ret->sendresult->error;
else {
    echo
$ret->sendresult->id, "\n";
    echo
$ret->sendresult->balance, "\n";
    echo
$ret->sendresult->cost, "\n";
    echo
$ret->sendresult->cnt, "\n";
}


//Несколько сообщений разным абонентам:

$ret = $client->send_sms2(array("login"=>"alex", "psw"=>"123", "phones"=>"", "mes"=>"", "id"=>"", "sender"=>"", "time"=>0, "query"=>"list=79999999999:message1%0A79999999998:message2"));

if (
$ret->sendresult->error)
    echo
"Ошибка №".$ret->sendresult->error;
else {
    echo
$ret->sendresult->id, "\n";
    echo
$ret->sendresult->balance, "\n";
    echo
$ret->sendresult->cost, "\n";
    echo
$ret->sendresult->cnt, "\n";
}


// Получение стоимости

$ret = $client->get_sms_cost(array("login"=>"alex", "psw"=>"123", "phones"=>"79999999999", "mes"=>"Hello world!"));

if (
$ret->costresult->error)
    echo
"Ошибка №".$ret->costresult->error;
else {
    echo
$ret->sendresult->cost, "\n";
    echo
$ret->sendresult->cnt, "\n";
}


// Проверка статуса

$ret = $client->get_status(array("login"=>"alex", "psw"=>"123", "phone"=>"79999999999", "id"=>"999", "all"=>"0"));
    echo
"Ошибка №".$ret->statusresult->error;
else {
    echo
$ret->statusresult->status, "\n";
    echo
$ret->statusresult->last_date, "\n";
    echo
$ret->statusresult->err, "\n";
}


// Расширенный статус

$ret = $client->get_status(array("login"=>"alex", "psw"=>"123", "phone"=>"79999999999", "id"=>"999", "all"=>"2"));
    echo
"Ошибка №".$ret->statusresult->error;
else {
    echo
$ret->statusresult->status, "\n";
    echo
$ret->statusresult->last_date, "\n";
    echo
$ret->statusresult->err, "\n";
    echo
$ret->statusresult->last_timestamp, "\n";
    echo
$ret->statusresult->send_date, "\n";
    echo
$ret->statusresult->send_timestamp, "\n";
    echo
$ret->statusresult->phone, "\n";
    echo
$ret->statusresult->cost, "\n";
    echo
$ret->statusresult->sender_id, "\n";
    echo
$ret->statusresult->status_name, "\n";
    echo
$ret->statusresult->message, "\n";
    echo
$ret->statusresult->operator, "\n";
    echo
$ret->statusresult->region, "\n";
}


// Проверка баланса

$ret = $client->get_status(array("login"=>"alex", "psw"=>"123"));

if (
$ret->balanceresult->balance)
    echo
"Ошибка №".$ret->sendresult->error;
else
    echo
$ret->balanceresult->balance, "\n";

?>



© 2003–2024 SMS Center LLC
support@smscentre.com
Contacts
Design — Artemy Lebedev Studio
Site Information
SMS Center for Android Yandex. Metrica