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 the 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.


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

Sending a message

Sending an SMS message

To send an SMS message, use the SUBMIT_SM command according to the specification.

Поддерживаются следующие кодировки:
  • 7-bit GSM for Latin text with support for European characters − (coding = 0);
  • 8-bit ISO-8859-1 (ASCII) for Latin text or binary data − (coding = 1);
  • UCS2 (UCS-2BE or UTF-16BE) for national alphabets (for example, Russian) − (coding = 2).
The coding field is encoded by two bits in the composite data_coding field, so data_coding = coding * 4.

To use the ISO-8859-1 (ASCII) encoding instead of GSM when connecting, you need to specify:
system-type = "ISO"
You can add comments to the text of the SMS message , which are intended for the sender to view the message history in the personal account.

The SUBMIT_MULTI command for multiple mailing is not yet implemented.

The server does not accept more than one identical request for sending SMS messages within a minute to protect against errors and loops in the Client-side program in order to reduce the load and not spend the Client's funds, as well as to prevent multiple messages from being sent to the same subscriber.

The server also blocks sending more than 50 messages to one subscriber, which were sent with a break between messages of less than 30 seconds, to protect against flooding and unnecessary debiting of funds from the Client's account, since many operators do not pass a large number of messages to one subscriber in a short period of time.

When sending a composite message, all SMS parts must be transmitted to the server within a minute. Otherwise , the operator may reject the message, since to check for filters and templates, all SMS parts must first be glued together, and most operators wait no more than a minute.

Comments in SMS messages

When sending SMS messages, you can add any comment to the end of the text that clarifies or supplements the SMS message for the sender. This text will not be sent to subscribers and will not affect the cost of SMS and is available for viewing and filtering in the list of sent messages in your personal account.

To add a comment, you must specify a special combination "\n~~~\n " at the end of the text of the SMS message intended for sending (line feed, 3 of the tilde character, and again line feed), and after that, any text that will be considered a comment will not be sent to the subscriber, but will be displayed in the history.

Sending an MMS message

To send an MMS message, use the SUBMIT_SM command with the text " __MMS__: <message><message>\nsubj:<subject>" (text "__MMS__", colon, space, message text, line feed, text "subj", colon, subject of the MMS message).

Sending an e-mail message

To send an e-mail message, use the SUBMIT_SM command with the text " _ _ MAIL__: <message><message>\nsubj:<subject>" (text "_ _ MAIL__", colon, space, message text, line feed, word "subj", colon, subject of the e-mail message).

Sending a voice message (call)

To send a voice message, use the SUBMIT_SM command with the text " __CALL__: <message><message>\nvoice:<voice><voice>" (text "__CALL__", colon, space, message text, line feed, word "voice", colon, voice used to voice the text).

Possible values for the voice used:
  • m – male voice.
  • m2 – male voice 2.
  • m3 – male voice 3.
  • m4 (default) – male voice 4.
  • w – женский голос.
  • w2 – female voice 2.
  • w3 – female voice 3.
  • w4 – female voice 4.
When sending a voice message, you can specify a special combination "\n~~~\n" at the end of the text (line feed, 3 of the tilde character, and again line feed), after which you can pass the param parameterthat defines some characteristics of the call (for more information, see the description).

Sending a viber message

Для отправки viber-сообщения используйте команду SUBMIT_SM с текстом "__VIBER__: <message>" (text "__VIBER__", colon, space, message text).

When forming the message text, you can use special macros to create a button that will open the browser and click on the link specified in the macro, as well as attach files. More details additional features for sending viber messages are described in the documentation for the http protocol.

Sending a soc message

Для отправки soc-сообщения, отправляемого пользователям социальных сетей "Одноклассники", "ВКонтакте" или пользователям "Mail.Ru Агент", используйте команду SUBMIT_SM с текстом "__SOC__: <message>" (text " _ _ SOC__", colon, space, message text).

Sending HLR-query

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.
errКод ошибки, если абонент недоступен (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.

Пример результата HLR-запроса: 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–2023 SMS Center LLC
License no. 166255
support@smscentre.com
Contacts
Design — Artemy Lebedev Studio
Site Information
SMS Center for Android Yandex. Metrica