Пример работы с SMS шлюзом на языке Perl
Отправка смс
Получения статуса отправленной смс
Получение цены отправки
Получение баланса
Отправка смс:
#!/usr/bin/perl
use LWP::UserAgent;
my $ua = new LWP::UserAgent;
my $login = '';
my $password = '';
my $send_sms = '<?xml version="1.0" encoding="UTF-8"?>
<SMS>
<operations>
<operation>SEND</operation>
</operations>
<authentification>
<username>'.$login.'</username>
<password>'.$password.'</password>
</authentification>
<message>
<sender>SMS</sender>
<text>Test message [UTF-8]</text>
</message>
<numbers>
<number messageID="msg11">380972920000</number>
</numbers>
</SMS>';
my $response = $ua->post('http://api.myatompark.com/members/sms/xml.php',{ XML => $send_sms});
print $response->content;
Получения статуса отправленной смс*:
#!/usr/bin/perl
use LWP::UserAgent;
my $ua = new LWP::UserAgent;
my $login = '';
my $password = '';
my $get_sms_status = '<?xml version="1.0" encoding="UTF-8"?>
<SMS>
<operations>
<operation>SEND</operation>
</operations>
<authentification>
<username>'.$login.'</username>
<password>'.$password.'</password>
</authentification>
<statistics>
<messageid>msg11</messageid>
</statistics>
</SMS>';
my $response = $ua->post('http://api.myatompark.com/members/sms/xml.php',{ XML => $get_sms_status});
print $response->content;
* Информация о статусе смс будет доступна спустя несколько минут после отправки
Получение цены отправки:
#!/usr/bin/perl
use LWP::UserAgent;
my $ua = new LWP::UserAgent;
my $login = '';
my $password = '';
my $get_send_price = '<?xml version="1.0" encoding="UTF-8"?>
<SMS>
<operations>
<operation>GETPRICE</operation>
</operations>
<authentification>
<username>'.$login.'</username>
<password>'.$password.'</password>
</authentification>
<message>
<sender>SMS</sender>
<text>Test message [UTF-8]</text>
</message>
<numbers>
<number messageID="msg11">380972920000</number>
</numbers>
</SMS>';
my $response = $ua->post('http://api.myatompark.com/members/sms/xml.php',{ XML => $get_send_price});
print $response->content;
Получение баланса
#!/usr/bin/perl
use LWP::UserAgent;
my $ua = new LWP::UserAgent;
my $login = '';
my $password = '';
my $get_balance = '<?xml version="1.0" encoding="UTF-8"?>
<SMS>
<operations>
<operation>BALANCE</operation>
</operations>
<authentification>
<username>'.$login.'</username>
<password>'.$password.'</password>
</authentification>
</SMS>';
my $response = $ua->post('http://api.myatompark.com/members/sms/xml.php',{ XML => $get_balance});
print $response->content;
По запросу предоставляется необходимое количество дополнительных смс для тестирования сервиса массовых смс-уведомлений ePochta SMS.
Есть вопрос?
- 8 (800) 555-09-63
- Бесплатно по России
Новости:
- 2020-11-23
- ePochta объявляет старт Черной Пятницы: Спеццена на рассылку в WhatsApp
- 2020-11-18
- С 1 декабря 2020 года оператор МТС повышает стоимость СМС
- 2020-05-04
- Вебинар: СМС маркетинг. Что писать в тексте СМС рассылок?
- 2020-04-28
- Операторы повышают цены СМС рассылки по прямому каналу в РФ
- 2019-12-21
- Украинские операторы повышают цену СМС


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