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

Sending an HLR request

To send an HLR request, use the SUBMIT_SM command with the text __HLR__. The result of the request comes in the usual status (Delivery Report), which can be received both via the SMPP connection and via HTTP to your handler.

Status format with the result of an HLR request returned by SMPP: id:<id> stat:<status> err:<err> imsi:<imsi> msc:<msc> mcc:<mcc> mnc:<mnc> cn:<cn> net:<net> rcn:<rcn> rnet:<rnet>
Description of parameters:

OptionThe value
idMessage ID.
statusMessage status.
errError code if the subscriber is unavailable (list).
imsiUnique IMSI code of the subscriber's SIM card.
mscThe number of the service center of the operator in whose network the subscriber is located.
mccNumeric code of the subscriber's country.
mncNumeric code of the subscriber's operator.
cnName of the country of registration of the subscriber.
netName of the subscriber registration operator.
rcnThe name of the roaming country of the subscriber when he is in a foreign network.
rnetThe name of the roaming operator of the subscriber when he is in someone else's network.

String data, such as country and operator, is encoded via the urlencode function.

Example of the result of an HLR request: id:855469 stat:DELIVRD err:000 imsi:250023012345678 msc:79232510066 mcc:250 mnc:02 cn:Russian+Federation net:MegaFON+open+Joint+Stock+Company rcn: rnet:
Sample PHP code for parsing a string with the result of an HLR request:
$dlr = strtr($dlr, ": ", "=&"); // $dlr - строка статуса
parse_str($dlr, $m); // $m - массив параметров, $m["id"], $m["err"], $m["imsi"] и тд.

Example of parsing through regular expressions:
preg_match("/^id:(\d+) stat:(\w+) err:(\d+) imsi:(\d*) msc:(\d*) mcc:(\d*) mnc:(\d*) cn:([^ ]*) net:([^ ]*) rcn:([^ ]*) rnet:([^ ]*)/", $dlr, $m); // $dlr - строка статуса
for ($i = 6; $i <= 9; $i++)
   
$m[$i] = urldecode($m[$i]);
// $m - массив параметров, $m[1] = id, $m[2] = status, $m[3] = err и тд.

To send a Ping-SMS, use the SUBMIT_SM command with the text _ _ PING__.



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