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 a message

Sending an SMS message

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

The following encodings are supported:
  • 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 to send SMS messages within a minute to protect against errors and loops in the Client-side program in order to reduce the load and not waste the Client's funds, as well as to prevent multiple messages from being sent to one 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 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 (default) – male voice 3.
  • m4 – male voice 4.
  • w – a woman's voice.
  • w2 – female voice 2.
  • w3 – female voice 3.
  • w4 – female voice 4.
When sending messages, it is also possible to specify the language of the text in the form: "m,en", "w,fr", "w,de", etc..

In the process of forming a message, at the end of the text, you can specify a special combination "\n~~~\n" (line feed, 3 tilde character and line feed again), after which you pass the param parameter, which determines some characteristics of the call (more details can be found in the description).

Sending a viber message

To send a viber message, use the SUBMIT_SM command with the text "__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

To send a soc message sent to users of the Odnoklassniki, VKontakte, or Mail.Ru Agent social networks, use the SUBMIT_SM command with the text "__SOC__: <message>" (text " _ _ SOC__", colon, space, message text).

Sending a message to Telegram

To send the confirmation code to Telegram, use the SUBMIT_SM command with the text "__TGM__: <code>" (text "__TGM__", colon, space, confirmation code).

Only numeric codes with a length from 4 to 8 digits are accepted for sending.

Sending a message to the Telegram chatbot

To send a message to the Telegram chatbot, use the SUBMIT_SM command with the text "__BOT__: <message>\nbot:@<bot_name>" (text "__BOT__", colon, space, message text, line feed, text "bot", colon, bot name).

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