Пример работы с SMS шлюзом на языке PHP
Отправка смс
Получения статуса отправленной смс
Получение цены отправки
Получение баланса
Отправка смс:
<?php
$src = '<?xml version="1.0" encoding="UTF-8"?>
<SMS>
<operations>
<operation>SEND</operation>
</operations>
<authentification>
<username></username>
<password></password>
</authentification>
<message>
<sender>SMS</sender>
<text>Test message [UTF-8]</text>
</message>
<numbers>
<number messageID="msg11">380972920000</number>
</numbers>
</SMS>';
$Curl = curl_init();
$CurlOptions = array(
CURLOPT_URL=>'http://api.myatompark.com/members/sms/xml.php',
CURLOPT_FOLLOWLOCATION=>false,
CURLOPT_POST=>true,
CURLOPT_HEADER=>false,
CURLOPT_RETURNTRANSFER=>true,
CURLOPT_CONNECTTIMEOUT=>15,
CURLOPT_TIMEOUT=>100,
CURLOPT_POSTFIELDS=>array('XML'=>$src),
);
curl_setopt_array($Curl, $CurlOptions);
if(false === ($Result = curl_exec($Curl))) {
throw new Exception('Http request failed');
}
curl_close($Curl);
echo $Result;
?>
Получения статуса отправленной смс*:
<?php
$src = '<?xml version="1.0" encoding="UTF-8"?>
<SMS>
<operations>
<operation>GETSTATUS</operation>
</operations>
<authentification>
<username></username>
<password></password>
</authentification>
<statistics>
<messageid>msg11</messageid>
</statistics>
</SMS>';
$Curl = curl_init();
$CurlOptions = array(
CURLOPT_URL=>'http://api.myatompark.com/members/sms/xml.php',
CURLOPT_FOLLOWLOCATION=>false,
CURLOPT_POST=>true,
CURLOPT_HEADER=>false,
CURLOPT_RETURNTRANSFER=>true,
CURLOPT_CONNECTTIMEOUT=>15,
CURLOPT_TIMEOUT=>100,
CURLOPT_POSTFIELDS=>array('XML'=>$src),
);
curl_setopt_array($Curl, $CurlOptions);
if(false === ($Result = curl_exec($Curl))) {
throw new Exception('Http request failed');
}
curl_close($Curl);
echo $Result;
?>
* Информация о статусе смс будет доступна спустя несколько минут после отправки
Получение цены отправки:
<?php
$src = '<?xml version="1.0" encoding="UTF-8"?>
<SMS>
<operations>
<operation>GETPRICE</operation>
</operations>
<authentification>
<username></username>
<password></password>
</authentification>
<message>
<sender>SMS</sender>
<text>Test message [UTF-8]</text>
</message>
<numbers>
<number messageID="msg11">380972920000</number>
</numbers>
</SMS>';
$Curl = curl_init();
$CurlOptions = array(
CURLOPT_URL=>'http://api.myatompark.com/members/sms/xml.php',
CURLOPT_FOLLOWLOCATION=>false,
CURLOPT_POST=>true,
CURLOPT_HEADER=>false,
CURLOPT_RETURNTRANSFER=>true,
CURLOPT_CONNECTTIMEOUT=>15,
CURLOPT_TIMEOUT=>100,
CURLOPT_POSTFIELDS=>array('XML'=>$src),
);
curl_setopt_array($Curl, $CurlOptions);
if(false === ($Result = curl_exec($Curl))) {
throw new Exception('Http request failed');
}
curl_close($Curl);
echo $Result;
?>
Получение баланса
<?php
$src = '<?xml version="1.0" encoding="UTF-8"?>
<SMS>
<operations>
<operation>BALANCE</operation>
</operations>
<authentification>
<username></username>
<password></password>
</authentification>
</SMS>';
$Curl = curl_init();
$CurlOptions = array(
CURLOPT_URL=>'http://api.myatompark.com/members/sms/xml.php',
CURLOPT_FOLLOWLOCATION=>false,
CURLOPT_POST=>true,
CURLOPT_HEADER=>false,
CURLOPT_RETURNTRANSFER=>true,
CURLOPT_CONNECTTIMEOUT=>15,
CURLOPT_TIMEOUT=>100,
CURLOPT_POSTFIELDS=>array('XML'=>$src),
);
curl_setopt_array($Curl, $CurlOptions);
if(false === ($Result = curl_exec($Curl))) {
throw new Exception('Http request failed');
}
curl_close($Curl);
echo $Result;
?>
По запросу предоставляется необходимое количество дополнительных смс для тестирования сервиса массовых смс-уведомлений ePochta SMS.
Есть вопрос?
- 8 (800) 555-09-63
- Бесплатно по России
Новости:
- 2020-11-27
- Внимание! С 1 декабря 2020 года меняется цена на отправку СМС в сети Билайн
- 2020-11-23
- ePochta объявляет старт Черной Пятницы: Спеццена на рассылку в WhatsApp
- 2020-11-18
- С 1 декабря 2020 года оператор МТС повышает стоимость СМС
- 2020-05-04
- Вебинар: СМС маркетинг. Что писать в тексте СМС рассылок?
- 2020-04-28
- Операторы повышают цены СМС рассылки по прямому каналу в РФ


7 (495) 649-62-48
Украинский
Казахский
English
Italiano
