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 MESSAGES

MANAGING MAILING LISTS

MESSAGE STATUSES

CHECKING THE BALANCE STATUS

CONTACT MANAGEMENT

CLIENT MANAGEMENT

MANAGING SENDER NAMES (SENDER ID)

GETTING DATA

VARIOUS

Sending messages

Sending an SMS message

To send an SMS, you need to call the GET or POST address method: https://smscentre.com/sys/send.php?login=<login>&psw=<password>&phones=<phones>&mes=<message>
To get the SMS cost, you need to call the GET or POST address method: https://smscentre.com/sys/send.php?login=<login>&psw=<password>&phones=<phones>&mes=<message>&cost=1
Description of the parameters passed to the Server :

OptionThe value
loginCustomer Login.
pswClient Password (you can add or change it on this page).
phonesThe number or comma-separated or semicolon-separated list of mobile phone numbers in international format to which the message is sent. Numbers can be passed without the "+ " sign. If the number is passed without the " + " sign, it can be corrected by automatic formatting and converted to the correct international format. Thus, some errors when entering phone numbers can be corrected automatically. To disable auto-correction, pass the number with the "+ " sign.".
You can also send a message to a group of numbersby specifying a special code " G<номер группы>". The message will be sent to all numbers belonging to this group. For an e-mail message, a list of recipients' e-mail addresses is transmitted .
mesThe text of the message being sent. The maximum size is 1000 characters. If necessary, the message will be divided into several SMS messages sent to the subscriber and paid separately. Size of one SMS Ц 160 characters in Latin or 70 characters in Cyrillic. When splitting a message into multiple SMS messages, a header is added to each part to combine the parts into a single message on the recipient's phone, and the maximum length becomes 67 for Cyrillic and 153 for Latin letters. You can add comments to the message text that are intended for the sender to view the history in the personal account.
Additional options
idThe message ID. Assigned by the Client. Serves for further identification of the message. If not specified, it will be assigned automatically. Not necessarily unique. The identifier is a 32-bit number in the range from 1 to 2147483647, or a string up to 40 characters long consisting of Latin letters, numbers, and symbols ."-_".
senderThe sender's name displayed on the recipient's phone. English letters, numbers, spaces, and some characters are allowed. Length Ц 11 characters or 15 digits. All names are registered in your personal account on this page.
translitA sign that the message you want to translate in translit.
0 (default) Ц do not translate into transliteration.
1 Ц translate to translit as " translate".
2 Ц translate into transliteration as " mpaHc/Ium".
tinyurlAutomatically shorten links in messages. Allows you to replace links in the message text with short ones to reduce the length, as well as to track the number of clicks on this page.
0 (default) Ц leave links in the message text without changes.
1 Ц shorten links.
timeThe time of sending the SMS message to the subscriber.
Formats:
  1. DDMMYYhhmm or DD.MM.YY hh: mm.
  2. h1-h2. Sets the time range in hours. If the current time is less than h1, the SMS message will be sent to the subscriber when the time h1 occurs, if the current time falls in the interval from h1 to h2, that message will be sent immediately, otherwise the message will be sent the next day when the h1 time is reached. This function, for example, is useful in order to prevent subscribers from receiving SMS messages at night.
  3. 0ts, where ts is timestamp, the time in seconds since January 1, 1970.
  4. +m. Sets the relative time offset from the current time in minutes. The + character must be encoded as %2B in the http request.
If time = 0 or the time already elapsed is specified, the message will be sent immediately.
tzThe time zone in which the time parameter is set. It is indicated relative to Moscow time. The tz parameter can be either positive or negative. If tz is equal to 0, the Moscow time zone will be used , if the tz parameter is not set, the time zone will be taken from the Client settings.
periodThe period of time during which you need to send the newsletter. Represents a number in the range from 0.1 to 720 hours. Used in conjunction with the freq parameter. This parameter allows you to stretch the mailing list in time for the gradual receipt of SMS messages by subscribers.
freqThe interval or frequency at which to send an SMS message to the next group of numbers. The number of numbers in the group is calculated automatically based on the period and freq parameters. Set in the interval from 1 to 1440 minutes. Without the period parameter, the freq parameter is ignored.
flashIndicates whether a Flash message is displayed immediately on the phone screen.
0 (default) Ц normal message.
1 Ц Flash message.
binBinary message flag.
0 (default) Ц normal message.
1 Ц binary message. In an http request, it must be encoded using the urlencode function.
2 Ц binary message, represented as a hexadecimal string (hex).

The binary message is passed along with the UDH header at the beginning in the mes parameter, in which the first byte specifies the length of the header. To send a binary message without a UDH header, specify a null byte at the beginning of the message (00 in hex).
To be able to pass the pid and dcs parameters, you need to add a special combination "\n~~~\n" (line feed, 3 tilde characters, and again line feed) to the end of the binary message, and then the text "pid: value1, dcs: value2" with the exact preservation of spaces.
pushA sign of a wap-push message, with which you can send an Internet link to your phone.
0 (default) Ц normal message.
1 Ц wap-push message. In the mes parameter, you must pass the link and title through a line feed.
hlrA sign of the HLR-request for information about the number from the operator's database without sending real SMS.
0 (default) Ц normal message.
1 Ц HLR request. An HLR request will be executed for each phone number in the list. The mes parameter is not used.
pingIndicates a special SMS that is not displayed in the phone to check the numbers for availability in real time by the delivery status.
0 (default) Ц normal message.
1 Ц ping-sms. A Ping SMS will be sent to each phone number in the list. The mes parameter is not used.
mmsA feature of an MMS message that can be used to transmit text (txt), images in various formats (jpg, gif, png), music (wav, amr, mp3, mid), and video (mp4, 3gp). The files are passed in the body of the http request.
0 (default) Ц normal message.
1 Ц An MMS message. An MMS will be sent to each phone number in the list.
mailThe flag of the e-mail message. The files attached to the message are passed by the POST method in the body of the http request..
0 (default) Ц normal message.
1 Ц e-mail message.
socA sign of a soc message sent to users of the social networks "Odnoklassniki", "VKontakte" or to users of " Mail.Ru Agent".
0 (default) Ц normal message.
1 Ц soc message.
viberFlag of the viber message sent to users of the Viber messenger.
0 (default) Ц normal message.
1 Ц viber message.
whatsappA sign of a whatsapp message sent to WhatsApp messenger users.
0 (default) Ц normal message.
1 Ц whatsapp message.
fileurlThe full http address of the file to upload and transmit in the message. The minimum file size is 101 bytes.
callIndicates a voice message. When forming a voice message, you can send both text and attach files. Files added to the message must be passed by the POST method in the body of the http request..
0 (default) Ц normal message.
1 Ц voice message.
voiceThe voice used for voicing the text (only for voice messages).
m Ц male voice.
m2 Ц male voice 2.
m3 Ц male voice 3.
m4 (default) Ц male voice 4.
w Ц female voice.
w2 Ц female voice 2.
w3 Ц female voice 3.
w4 Ц female voice 4.
paramComma-separated list of parameters for a voice message in the format " param=w, i,n".
Here:
  • w Ц the waiting time for the caller to pick up the phone after the call starts, in seconds. If the subscriber does not pick up the phone within the specified time, the call will be repeated with the error "the subscriber is busy". The operating range of the parameter values is from 10 to 35, but you can specify an interval from 0 to 99 (if the value is less than 10, it will be reduced to 10, similarly for the upper bound).
  • i Ц repeat interval, that is, the time interval after which the call will be repeated (in seconds). The operating range of the parameter is from 10 to 3600 (if the value is less than 10, it will be reduced to 10).
  • n Ц the total number of dial-up attempts. Operating range of values from 1 to 9 (0 will be reduced to 1).
If you specify a value for any parameter other than the possible values, the default values of all parameters will be used (n = 8, w = 25, i from 3 to 14 seconds incrementally).
subjThe subject of the MMS or e-mail message. When sending an e-mail, you must specify the subject, text, and address of the sender. For MMS , it is mandatory to specify the subject or text. If you do not specify the subject of the MMS, then the sender's name, passed in the request or used by default, will be used as it.
charsetThe encoding of the transmitted message, if used other than the default windows encoding-1251. Options: utf-8 and koi8-r.
costIndicates whether you need to receive the cost of the mailing list.
0 (default) Ц normal sending.
1 Ц get the cost of mailing without real sending.
2 Ц normal sending, but add the cost of the completed mailing to the response.
3 Ц normal sending, but add the cost and the new Customer balance to the response.
fmtFormat of the server response about successful sending.
0 Ц (by default) as a string (OK - 1 SMS, ID - 1234).
1 Ц return the response in the form of numbers: ID and number of SMS separated by commas (1234,1), with cost = 2, another comma-separated cost (1234,1,1.40), with cost = 3, another new Customer balance (1234,1,1.40,100.50), with cost = 1, the cost and quantity Comma separated SMS (1.40,1).
2 Ц response in xml format.
3 Ц response in json format.
listA list of phone numbers and their corresponding messages, separated by a colon or semicolon, and presented as:
phones1:mes1
phones2:mes2
...
Lines are separated by a newline character (%0A). As phones, you can specify multiple phone numbers separated by commas. If you want to pass a newline character in the mes message, specify it with \n. If it is not possible to correct the text of a multi-line message, it is possible to enable a special mode for transmitting this type of message. To do this, you must additionally pass the nl parameterequal to 1 in the request.
If it is necessary to transmit different names of senders (and, possibly, different time zones of subscribers), the following transmission format can be used for different messages:
sender1,tz1|phones1:mes1
sender2,tz2|phones2:mes2
...
In this case, the tz parameter is optional.
The list parameter allows you to send multiple messages with different messages to multiple phones. an http request. The messages in the request are assigned a single identifier. The entire parameter must be encoded using the urlencode function.
validThe "life" period of the SMS message. Specifies the time during which the operator will attempt to deliver the message to the subscriber. Range from 1 to 24 hours. It is also possible to transmit the time in the hh:mm format in the range from 00:01 to 24:00.
maxsmsThe maximum number of SMS messages that a long message can be split into. Messages that are too long will be truncated so as not to overwhelm the number of SMS messages required to transmit them. With this parameter, you can limit the maximum cost of messages, since a separate fee is charged for each SMS.
imgcodeThe value of the alphanumeric code entered with "captcha" when using anti-spam verification. This parameter must be used in conjunction with the userip parameter.
useripThe value of the IP address to which to apply the limit on the maximum number of messages per IP address per day established in settings personal account in the "Limits and restrictions".
errIndicates whether to add a list of invalid numbers to the server response.
0 (default) Ц do not add a list (normal server response).
1 Ц a list of erroneous phone numbers with the corresponding statuses is added to the response.
opIndicates whether to add information for each number to the server response.
0 (default) Ц do not add a list (normal server response).
1 Ц the response adds a list of all phone numbers with their respective statuses, mcc and mnc values, cost, and, in the case of erroneous numbers, error codes..
ppBinds the Client as a referral to a specific partner ID for the current request.
ѕри передаче данного параметра в виде "pp=<ID партнера>"  лиент с логином login временно становитс€ рефералом партнера с ID <ID партнера>. Deductions for the partner program will be made for the current request, there is no permanent binding. This option allows you to temporarily install a Client as a referral from your services and programs, where it is not possible to register a Client using a referral link.


Required parameters are login, psw, phones, and mes, or login, psw and list.

After approval and processing, the Server returns confirmation to the Client indicating the result of processing.

All parameters that contain special characters (plus, space, etc.) must be encoded using the urlencode function to be passed in an HTTP request..

Server response and error codes

The server sends the response as a string:

If an error occurred, the response will be one of the following:

When fmt = 0:
  • ERROR = N (description) Ц for 1,2,4,5,9 errors;

  • ERROR = N (description), ID - <id сообщени€> Ц for 3 errors,6,7,8.
When fmt = 1:
  • 0,-N Ц for errors 1,2,4,5,9;
  • <id сообщени€>,-N Ц for 3 errors,6,7,8.
When fmt = 2:
  • For 1 errors,2,4,5,9:

    <result>
    <error>description</error>
    <error_code>N</error_code>
    </result>

  • For 3 errors,6,7,8:
    <result>
    <error>description</error>
    <error_code>N</error_code>
    <id>id сообщени€</id>
    </result>
When fmt = 3:
  • For 1 errors,2,4,5,9:
    {
    "error": "description",
    "error_code": N
    }

  • For 3 errors,6,7,8:
    {
    "error": "description",
    "error_code": N,
    "id": <id сообщени€>
    }
N Ц error number, can take the following values:

The valueDescription
1Error in parameters.
2Invalid username or password. Also occurs when trying to send a message from an IP address that is not included in the list of allowed by the Client (if such a list was previously configured by the Client).
3Insufficient funds on the Client's account.
4IP address is temporarily blocked due to frequent errors in the queries. read More
5Invalid date format.
6The message is forbidden (by text or by the sender's name). This error also occurs when you try to send mass and / or advertising messages without a signed contract.
7Invalid phone number format.
8The message to the specified number can not be delivered.
9Sending more than one identical SMS message request or more than five identical requests to receive the cost of a message within a minute.
This error also occurs when you try to send fifteen or more requests simultaneously from different connections under the same username (too many concurrent requests).

If the request is processed successfully, a string of the following format is returned:
  • when cost = 0 and fmt = 0: OK - <n> SMS, ID - <id>

  • when cost = 1 and fmt = 0: <cost> (<n> SMS)

  • when cost = 2 and fmt = 0: OK - <n> SMS, ID - <id>, COST - <cost>

  • when cost = 3 and fmt = 0: OK - <n> SMS, ID - <id>, COST - <cost>, BALANCE - <balance>

  • when cost = 0 and fmt = 1: <id>,<n>

  • when cost = 1 and fmt = 1: <cost>,<n>

  • when cost = 2 and fmt = 1: <id>,<n>,<cost>

  • when cost = 3 and fmt = 1: <id>,<n>,<cost>,<balance>

  • when cost = 0 and fmt = 2:
    <result>
    <id>id</id>
    <cnt>n</cnt>
    </result>

  • when cost = 1 and fmt = 2:
    <result>
    <cost>cost</cost>
    <cnt>n</cnt>
    </result>

  • when cost = 2 and fmt = 2:
    <result>
    <id>id</id>
    <cnt>n</cnt>
    <cost>cost</cost>
    </result>

  • when cost = 3 and fmt = 2:
    <result>
    <id>id</id>
    <cnt>n</cnt>
    <cost>cost</cost>
    <balance>balance</balance>
    </result>

  • when cost = 0 and fmt = 3:
    {
    "id": <id>,
    "cnt": <n>
    }

  • when cost = 1 and fmt = 3:
    {
    "cost": "<cost>",
    "cnt": <n>
    }

  • when cost = 2 and fmt = 3:
    {
    "id": <id>,
    "cnt": <n>,
    "cost": "<cost>"
    }

  • when cost = 3 and fmt = 3:
    {
    "id": <id>,
    "cnt": <n>,
    "cost": "<cost>",
    "balance": "<balance>"
    }

  • when op = 1 and fmt = 0 or 1, the information is added to the end of the normal output from a new line:
    <phone>,<mccmnc>,<cost>,<status>,<error>

  • when op = 1 and fmt = 2, an array is added to the response:
    <phones>
    <phone mccmnc="mccmnc" cost="cost" status="status" error="error">phone</phone>
    ...
    </phones>

  • when op = 1 and fmt = 3, an array is added to the response:
    "phones": [{
    "phone": "<phone>",
    "mccmnc": "<mccmnc>",
    "cost": "<cost>",
    "status": "<status>",
    "error": "<error>"
    },
    ...
    ]

Where:
<n><n> is the number of SMS sent, calculated as the number of SMS messages in the message multiplied by the number of recipients.
<id> Ц the message ID sent by the Client or assigned automatically by the Server.
<cnt> Ц the number of parts (when sending an SMS message) or the number of seconds (when sending a voice message (call)).
<balance> Ц new Customer Balance.
<phone> Ц phone number.
<mccmnc> Ц the numeric code of the subscriber's country plus the numeric code of the subscriber's operator.
<cost> Ц the cost of SMS-messages.
<status> Ц sMS Message status code.
<error> Ц error code in the status.

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

Examples of sending messages

Examples:

Normal message:

https://smscentre.com/sys/send.php?login=alex&psw=123&phones=79999999999&mes=Hello! https://smscentre.com/sys/send.php?login=alex&psw=123
&list=79999999999:Hello!%0A79999999999:Hello\nworld!

Flash message encoded in "utf-8" from the sender "ivan", translated into transliteration, which must be delivered to the subscriber 01.01.2012 in 00:00:

https://smscentre.com/sys/send.php?login=alex&psw=123&phones=79999999999&mes=Hello%20world!
&translit=1&time=0101120000&flash=1&sender=ivan
&charset=utf-8

Binary EMS message with the text " Hello, World!", in which the word "World" is italicized and underlined:

https://smscentre.com/sys/send.php?login=alex&psw=123&phones=79999999999
&mes=050A0307056048656C6C6F2C20576F726C6421&bin=2

Binary WAP-push message that sends a link to the site " http://wap.ru/":

https://smscentre.com/sys/send.php?login=alex&psw=123&phones=79999999999
&mes=0605040B8423F0DC0601AE02056A0045C60C037761702E72752F0001037761702E7275000101&bin=2

WAP-push message in text form, transmitting a link to the site "http://wap.ru" with the title " WAP.RU":

https://smscentre.com/sys/send.php?login=alex&psw=123&phones=79999999999
&mes=http://wap.ru%0AWAP.RU&push=1

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.

Examples:

Sending a single message:

Hello!
~~~
Comment
https://smscentre.com/sys/send.php?login=alex&psw=123&phones=79999999999%2C78888888888&mes=Hello!%0A~~~%0AComment
Sending multiple messages via the list parameter:

Hello1!
~~~
Comment1
Hello2!
~~~
Comment2
https://smscentre.com/sys/send.php?login=alex&psw=123&list=79999999999:Hello1!\n~~~\nComment1%0A78888888888:Hello2!\n~~~\nComment2

Sending to a group of numbers

¬ личном кабинете  лиента при создании или редактировании группы можно указать номер группы дл€ рассылок сообщений. “огда при отправке сообщени€ вместо списка телефонов можно будет указывать короткий код в виде "G<номер группы>" или "g<номер группы>", and the message will be sent to all phone numbers belonging to this group.

Examples:

Sending a message to all phone numbers belonging to groups with assigned numbers 777 and 888:

https://smscentre.com/sys/send.php?login=alex&psw=123&phones=G777%2Cg888&mes=Hello!

Sending HLR-query

You can check phone numbers for availability by sending a special HLR request. As a result of the request, data will be received about the country and the subscriber's operator, about the roaming operator when the subscriber is in a foreign network, as well as about the status of the subscriber (available or not). Subscribers who are the owners of the verified numbers will not receive any notifications about the performed checks of their number.

Execution of an HLR request over the HTTP protocol is performed in the same way as sending an SMS message, and the request must pass an additional parameter hlr=1.

To send an HLR request, use the GET or POST method to call the address: https://smscentre.com/sys/send.php?login=<login>&psw=<password>&phones=<phones>&hlr=1
Other parameters that are used for sending regular SMS messages and described on this page are also available.

The result of the HLR request can be sent to the URL for receiving incoming messages and statuses specified in the settings in your personal account, or it can be read by requesting the status of the sent SMS message.

Example:
https://smscentre.com/sys/send.php?login=alex&psw=123&phones=79999999999&hlr=1

Sending an MMS message

To send an MMS message, you need to call the GET or POST address method: https://smscentre.com/sys/send.php?login=<login>&psw=<password>&phones=<phones>&mes=<message>&mms=1
If you plan to send any files (text, music, audio, video), then you need to send them using the POST method in the body http (s)-request to the server. It is also possible to send an external file in the request via the fileurlparameter, which contains the full http (s) address of the file, or to add an https link to the message text of a previously downloaded file, which you can find out in your personal account on the sending page by clicking "attach file" - " Downloaded files".

The maximum number of attachments passed in a request is twenty, and the total size of all attachments must not exceed 300 KB. If the specified limits are exceeded, the remaining attachments will be transmitted as links. For an MMS message, specify the subject or text it is mandatory.

Examples:

Sending an MMS message with the subject "Privet" and the text " Hello":

https://smscentre.com/sys/send.php?login=alex&psw=123&phones=79999999999&mes=Hello&subj=Privet&mms=1
Sending MMS with the subject "Holiday" and two photos via library based on cURL:

<?php
include "smsc_api.php";
send_sms("79999999999", "", 0, 0, 0, 7, false, "subj=Holiday", array("/home/alex/1.jpg", "/home/alex/2.jpg"));
?>

Sending an e-mail message

To send an e-mail, you need to call the GET or POST address method: https://smscentre.com/sys/send.php?login=<login>&psw=<password>&phones=<phones>&mes=<message>&sender=<sender>&subj=<subj>&mail=1
If you plan to transfer any files when sending them, then they must be transmitted by the POST method in the body of an http(s) request to the server. The positions in the text in which you plan to insert files must be designated in a special way in the form of "<file n><file n>", where n is the file number in the generated list starting from one. If you do not specify the positions, then the corresponding files will be added to the end of the message.

ѕри создании сообщени€ можно вставл€ть в текст http(s)-ссылки ранее загруженных файлов, узнать которые можно в личном кабинете на странице отправки, нажав последовательно ссылки "прикрепить файл" Ц "«агруженные файлы". “акже можно указывать локальные ссылки на загруженные файлы на нашем сервере в виде "<file /upload/files/sms/каталог_загрузки/название_файла>". ƒл€ вложений-картинок можно устанавливать атрибуты, например, "<file /upload/files/sms/каталог_загрузки/название_файла width=200 height=400>". To download a file from an external source, you can pass an additional fileurl parameter in the request containing the full http(s) address of the file.

The maximum number of attachments transmitted in a request is 20, and the size of each attachment should not exceed 10 MB. If the specified limits are exceeded, an error with the code 1 (incorrect parameters) will be returned. When sending each email, the maximum total size of attached attachments is 15 MB, attachments that do not fit into this size will be transmitted by a link to our website.

By default, a special unsubscribe link is added to the end of the message text. To disable this link, you need to add a special macro {no_unsub} to any place in the text of the letter.

For e-mail messages, specifying the subject, text and sender's address is mandatory.

Examples of sending e-mail messages

Examples:

Sending an e-mail to the address " alex@mysite.com "with the subject "Privet" and the text "Hello" from the sender " alex2@mysite2.com":

https://smscentre.com/sys/send.php?login=alex&psw=123&phones=alex%40mysite.com&mes=Hello&subj=Privet&sender=alex2%40mysite2.com&mail=1
Send e-mail with the subject "Holiday" and two photos via library based on cURL:

<?php
include "smsc_api.php";
send_sms("alex@mysite.com", "Hello", 0, 0, 0, 8, "alex2@mysite2.com", "subj=Holiday", array("/home/alex/1.jpg", "/home/alex/2.jpg"));
?>

Send e-mail with the subject "Hello" and a photo that you previously downloaded to the server:

<?php
include "smsc_api.php";
send_sms("alex@mysite.com", "Hello, this is my photo &lt;file /upload/files/sms/123abc/photo.jpg width=200 height=400>", 0, 0, 0, 8, "alex2@mysite2.com", "subj=Hello");
?>

Sending a voice message (call)

To send a voice message, you need to call the address using the GET or POST method: https://smscentre.com/sys/send.php?login=<login>&psw=<password>&phones=<phones>&mes=<message>&call=1
When forming a message, you can specify both text and add wav and mp3 media files.

If you plan to transfer files, then they must be transmitted by the POST method in the body of an http(s) request to the server. The positions in the text in which you plan to insert files must be designated in a special way in the form of "<file n><file n>", where n is the file number in the generated list starting from one. If you do not specify the positions, then the corresponding files will be added to the end of the message.

ѕри создании сообщени€ можно вставл€ть в текст http(s)-ссылки ранее загруженных файлов, узнать которые можно в личном кабинете на странице отправки, нажав последовательно ссылки "прикрепить файл" Ц "«агруженные файлы". “акже можно указывать локальные ссылки на загруженные файлы на нашем сервере в виде "<file /upload/files/sms/каталог_загрузки/название_файла>". To download a file from an external source, you can pass an additional fileurl parameter in the request containing the full http(s) address of the file. In this case, passing the mes parameter in the request is optional.

Since telephone lines cannot perfectly play complex media files, when forming a sent message, the transmitted files are converted to a simple format.

When sending a voice message, the initial time and cost are calculated approximately. After sending and listening to messages the subscriber, the duration and the call cost or adjusted downwards (for example, if the subscriber has not heard the message through), or if the duration of the message exceeds the calculated, the difference in seconds is indicated in comments to the message in the form of extra time, overtime, including those which displayed in detail in a separate entry. Also, overtime may occur when using the voice menu (IVR).

The maximum number of attachments transmitted in a request is four, and the size of each attachment should not exceed 5 MB. If the specified limits are exceeded, processed attachments will be excluded.

To send your phone number as the sender's name, you must specify it in the sender parameter. The specified number must first be added and activated in the personal account on this page.

When forming a request, you can pass a special parameter param, which specifies some characteristics of the call (more details can be found in the description). Additionally, you can also pass the voice parameter in the request, which determines the voice used for voicing the text. This parameter can take the following values:
  • voice = m Ц male voice.
  • voice = m2 Ц male voice 2.
  • voice = m3 Ц male voice 3.
  • voice = m4 Ц male voice 4.
  • voice = w Ц female voice.
  • voice = w2 Ц female voice 2.
  • voice = w3 Ц female voice 3.
  • voice = w4 Ц female voice 4.

Using the voice menu (IVR)

To use the voice menu, you must send a text or voice file with the initial instructions for the subscriber at the beginning of the message text and then specify a macro containing the service menu commands {menu: <...>}, where <...> description of the voice menu options.

Schematically, the message using the voice menu looks like this:
—“ј–“ќ¬џ… “≈ —“

{menu: [“≈ —“ ћ≈Ќё]
1: “≈ —“ или  ќћјЌƒј
2
: “≈ —“2 или  ќћјЌƒј2
...
}

 ќЌ≈„Ќџ… “≈ —“

After picking up the phone, the subscriber is given the "START TEXT", then the "MENU TEXT" is played with a description of the menu items and acceptable actions. After pressing the key on the numeric keypad of the phone corresponding to the desired item, the subscriber can be voiced the text "TEXT" or perform one or more consecutive "COMMANDS". After exiting the menu, the "END TEXT" is voiced".

Description of the parameters used in the {menu} macro: <...>}:

OptionThe value
*: backReturn to the previous menu.
#: startReturn to the beginning of the menu and repeat the " MENU TEXT".
0: repeatRepeat the selected item.
n: msgThe menu item that the subscriber enters when pressing the nkey, where n is the number of the menu item, which can take values from 1 to 9, msg is a message or command. Menu items can be duplicated one by one to perform multiple actions when a single key is pressed.
nm: msgSub-item m of the menu item n, which the subscriber enters when pressing the mkey . It can take values from 1 to 9. msg-message or command. Menu items can be duplicated one by one to perform multiple actions when you press a single key. The nesting of sub-items is limited only by the size of the entire message (1000 characters).

In paragraphs and sub-paragraphs, you can use the following commands:

TeamThe value
urlThe http (s) address of the Client handler, to which information about the current item and the time when the subscriber is in the menu will be transmitted.
call:phone wait=n ok:end err:n recordRedirects the caller's call to the specified phone number, where the required parameter is phone-phone number or a comma-separated list of phone numbers. You can specify up to 9 numbers. The numbers to which the subscriber's call will be redirected must be registered on this page.
Optional parameters are:
Ц wait=n Ц the waiting time for the caller to pick up the phone, where n is the waiting time in seconds. The range of possible parameter values is from 0 to 120. By default, the waiting time for the subscriber to pick up the phone is 120 seconds.
Ц ok:end Ц after successfully connecting to the specified number and ending the dialog, end the voice menu.
Ц err:n Ц if you can't reach the specified number, then go to the step or label ndescribed in the menu body. The label can take the value of any set of Latin letters and numbers.
Ц record Ц after a successful connection with the specified number, record the conversation. The recording time for one call is limited to a maximum of 30 minutes. Also, the connection and recording is interrupted after 30 seconds of silence on the part of the subscribers. This parameter is specified last. The link to the recording is displayed in the message history under the text of the voice menu.
sms:phone,sender,msgSending an SMS message to the specified phone number, where phone is the phone number, sender is the sender's name, and msg is the message text. As a phone number, as well as in the message text, a special variable $phone can be specified, which, when sent, will be replaced with the phone number of the subscriber who received this voice menu..
record: nRecording of a fragment of the subscriber's voice response, which will be performed from the moment of activation until the end of the command, where n is the time for recording in seconds. By default (without explicitly specifying the time), recording is limited to 30 seconds. Also, the recording is interrupted after 10 seconds of silence on the part of the subscriber.
endIndicates whether to exit the voice menu. After exiting, the "END TEXT" will be read".
Examples:

<?php
$url
= 'https://smscentre.com/sys/send.php?login=alex&psw=123&phones=79999999999,79999999998&call=1&charset=utf-8&mes=';

$msg = '«дравствуйте!

{menu: Ќажмите 1 дл€ первого пункта, 2 дл€ второго пункта, 3 дл€ отправки за€вки на обратный звонок, 5 дл€ св€зи с оператором, решетка дл€ перехода в начало, 0 дл€ повтора, дл€ возврата в предыдущее меню нажмите звЄздочку.
*: back
#: start
0: repeat
1: пункт 1, нажмите 1 дл€ подпункта 1, 2 дл€ подпункта 2, 3 дл€ подпункта 3
11: подпункт 1.1
12: подпункт 1.2
13: подпункт 1.3
2: пункт 2, нажмите 1 дл€ подпункта 2.1
21: подпункт 2.1
3: sms:79999999999,Sender,текст
3: end
4: sms:$phone,Sender,¬аш номер: $phone
4: end
5: url
5: call:79999999999,79999999998 wait=10 ok:end err:6
6: call:79999999997 wait=60 ok:end err:callerr record
7: —ейчас начнетс€ запись до 10 секунд
7: record: 10
7:  онец записи
err: неверный номер, нажмите 0 дл€ повтора
callerr: »звините, не удалось дозвонитьс€ до оператора, выберите другой пункт или повторите попытку позже}

¬сего вам доброго!'
;

echo
file_get_contents($url.urlencode($msg));
?>

Examples of sending voice messages

Examples:

Sending a voice message with the text " Hello":

https://smscentre.com/sys/send.php?login=alex&psw=123&phones=79999999999&mes=Hello&call=1
Sending a voice message with the text "Hello" from phone number "79991234567":

https://smscentre.com/sys/send.php?login=alex&psw=123&phones=79999999999&mes=Hello&call=1&sender=79991234567
Sending a voice message with the text "Hello world", voiced by a male voice, with a waiting time for picking up the phone 20 seconds, a repeat interval 10 seconds and the number of attempts to dial equal to 3:

https://smscentre.com/sys/send.php?login=alex&psw=123&phones=79999999999&mes=Hello%20world&call=1&voice=m&param=20%2C10%2C3
Sending a voice message with the text "Hello world", voiced by a female alternative voice:

https://smscentre.com/sys/send.php?login=alex&psw=123&phones=79999999999&mes=Hello%20world&call=1&voice=w2
Sending a voice message with a voice file attached via the fileurl parameter:

https://smscentre.com/sys/send.php?login=alex&psw=123&phones=79999999999&call=1&fileurl=http://mysite.com/voice.wav
Sending a voice message with text and two audio files via a cURL-based library:

<?php
include "smsc_api.php";
send_sms("79999999999", "first file <file 1> and second file <file 2>", 0, 0, 0, 9, false, "", array("/home/alex/1.mp3", "/home/alex/2.wav"));
?>

Sending a viber message

To send a viber message, you must call the GET or POST address method: https://smscentre.com/sys/send.php?login=<login>&psw=<password>&phones=<phones>&mes=<message>&viber=1

Sending images

≈сли на каждый номер планируетс€ отправл€ть отдельную картинку в сообщении, то в этом случае необходимо либо передавать полный http(s)-адрес внешнего файла в виде <file http(s)://...>, or send an additional fileurl parameter in the request that contains the full http(s) address of the image. When using fileurl, passing the mes parameter in the request is optional.

If, when creating a mailing list, one text is supposed to be sent to several numbers, then you need to insert the full http(s) link of the previously uploaded image file into the message text, which you can find out in your personal account on the sending page by clicking "attach file"-"Uploaded files". The attached file must not exceed 512 Kb in size and must meet one of the following formats: JPG, GIF, PNG.

Adding a button

To insert a button in the message, when you click on it, you will open the browser and go to the specified address, you need to add a special macro {button,url,text} to the message text, where:
<button> Ц macro name.
<url> Ц full http address of the link that will be clicked when the button is clicked.
<text> Ц the text of the button. The length of the text can not exceed 30 characters.

To insert a button into the message, when you click on it, the subscriber will be called to the specified phone number, you need to add a special macro to the message text {button, tel:79999999999, text}.

Message types

The system supports the following types of viber messages:
  • Text only-the subscriber receives a text message.
  • Picture only-the subscriber receives the picture.
  • The text+button Ц subscriber receives a text message, which is located under the button. When you press the button, the transition occurs on a given link.
  • The text+button+picture Ц caller receives a text message, which is located under the picture and button. When you press the button, the transition occurs on a given link.
To configure the software and test sending viber messages, you can use our common sender name "SMSC" and predefined templates:
  • Hello! This is test message
  • Hello! This is a test message
  • Test
  • Test
  • Test {button,https://smscentre.com,site}
  • Test {button, https://smscentre.com, site}
  • Picture <file http://smscentre.com/im/smsc_logo_tiny.gif>
  • Image <file http://smscentre.com/im/smsc_logo_tiny.gif>
As in the templates for operators, the general rules for creating messages for the specified templates apply here (at the bottom of the page, the drop-down tab "Template registration rules").

Examples of sending viber messages

Examples:

Sending a viber message with the text " Hello":

https://smscentre.com/sys/send.php?login=alex&psw=123&phones=79999999999&mes=Hello&viber=1
Sending a viber message using one of the predefined templates for testing with the text "Test", the button "{button, http://smscentre.com, Site} "and the image previously uploaded in your personal account and having the address" http://smscentre.com/upload/files/sms/1856f97d/6_1.jpg":

https://smscentre.com/sys/send.php?login=alex&psw=123&phones=79999999999&viber=1&mes=Test+%7Bbutton%2Chttp%3A%2F%2Fsmscentre.com%2CSite%7D+http%3A%2F%2Fsmscentre.com%2Fupload%2Ffiles%2Fsms%2F1856f97d%2F6_1.jpg
Sending a viber message using one of the predefined templates for testing with the text "test", the button "{button, http://smscentre.com, Site} "and the image located on the external resource" https://mysite.com/sms/picture.jpg":

https://smscentre.com/sys/send.php?login=alex&psw=123&phones=79999999999&viber=1&mes=test+%7Bbutton%2Chttp%3A%2F%2Fsmscentre.com%2CSite%7D+%3Cfile+https%3A%2F%2Fmysite.com%2Fsms%2Fpicture.jpg%3E
Sending a viber message using one of the predefined test templates with the text "test", the button "{button, http://smscentre.com, Site} "and the picture" https://mysite.com/sms/picture.jpg " passed via the fileurl parameter:

https://smscentre.com/sys/send.php?login=alex&psw=123&phones=79999999999&viber=1&mes=test+%7Bbutton%2Chttp%3A%2F%2Fsmscentre.com%2CSite%7D&fileurl=https%3A%2F%2Fmysite.com%2Fsms%2Fpicture.jpg

Using prefixes when sending messages

To send various types of messages you can use the special prefix at the start or instead of text messages.

Supported prefixes:

NameDescription
__CALL__: messageSending a voice message (call). When sending a voice message, at the end of the text, you can specify a special combination "\n~~~\n" (line feed, 3 of the tilde character, and again line feed), after which you can pass the param parameter that determines some characteristics of the call (for more information, see the description). When forming a message, you can specify both text and add wav and mp3 media files, as well as insert previously downloaded files. More information on the process of creating a voice message can be found on this page.
__VIBER__: messageSending a message to users of the Viber messenger.
__SOC__: message Sending a message to users of the social networks "Odnoklassniki", "VKontakte" or users of " Mail.Ru Agent".
__PING__Sending a special SMS that is not displayed in the phone to check the numbers for availability in real time by the delivery status.
__HLR__Indicates an HLR request to get information about the number from the operator's database without sending a real SMS. More information on HLR queries can be found here.


Examples:

Sending a voice message with the text "Privet":

https://smscentre.com/sys/send.php?login=alex&psw=123&phones=79999999999&mes=__CALL__%3A%20Privet
Sending Ping-SMS:

https://smscentre.com/sys/send.php?login=alex&psw=123&phones=79999999999&mes=__PING__
Sending HLR-query:

https://smscentre.com/sys/send.php?login=alex&psw=123&phones=79999999999&mes=__HLR__

Managing message templates

To manage message templates, call the appropriate address with the required command and parameters using the GET or POST method.

To create a template: https://smscentre.com/sys/templates.php?add=1&login=<login>&psw=<password>&name=<name>&msg=<msg>
To change the template: https://smscentre.com/sys/templates.php?chg=1&login=<login>&psw=<password>&id=<id>
To delete a template: https://smscentre.com/sys/templates.php?del=1&login=<login>&psw=<password>&id=<id>
To get a list of templates: https://smscentre.com/sys/templates.php?get=1&login=<login>&psw=<password>
The following parameters are passed to the server:

OptionThe value
loginCustomer Login.
pswClient Password (you can add or change it on this page).
nameTemplate name.
msgThe text of the message.
formatMessage format:
empty string Ц not specified.
sms Ц SMS.
flash Ц Flash-SMS.
bin Ц Binary SMS.
push Ц Wap-push.
mms Ц MMS.
call Ц Call.
mail Ц E-mail.
viber Ц Viber.
senderSender ID.
fl[1]Use for auto-signing.

If an error occurs, the Server returns the following string:
  • when fmt = 0:
    ERROR = N (description)

  • when fmt = 1:
    0,-N

  • when fmt = 2:
    <result>
    <error>description</error>
    <error_code>N</error_code>
    </result>

  • when fmt = 3:
    {
    "error": "description",
    "error_code": N
    }
N Ц error number, can take the following values:

The valueDescription
1Error in parameters.
2Invalid username or password. Also occurs when trying to send a message from an IP address that is not included in the list of allowed by the Client (if such a list was previously configured by the Client).
3Record not found.
4The IP address is temporarily blocked.
5Save or delete error.
9Attempt to send more than three identical template action requests.
This error also occurs when you try to send fifteen or more requests simultaneously from different connections under the same username (too many concurrent requests).

If the request is successful, the Server returns a response in the form of a string:

When creating a template:
  • when fmt = 0: ID - <id>

  • when fmt = 1: <id>

  • when fmt = 2:
    <template>
    <id>id</id>
    </template>

  • when fmt = 3:
    {
    "id": <id>
    }

When changing or deleting a template:
  • when fmt = 0, 1: OK

  • when fmt = 2:
    <result>OK</result>

  • when fmt = 3:
    {
    "result": "OK"
    }


When requesting a list of message templates:
  • when fmt = 0:
    id = <id>, name = <name>, format = <format>, sender = <sender>, flag = <flag>, message = <message>
    ...

  • when fmt = 1:
    <id>,<name>,<format>,<sender>,<flag>,<message>
    ...

  • when fmt = 2:
    <list>
    <template>
    <id>id</id>
    <name>name</name>
    <format>format</format>
    <sender>sender</sender>
    <flag>flag</flag>
    <message>message</message>
    </template>
    ...
    </list>

  • when fmt = 3:
    [{
    "id": <id>,
    "name": "<name>",
    "format": "<format>",
    "sender": "<sender>",
    "flag": <flag>,
    "message": "<message>"
    },
    ...]

Where:
<id> Ц template ID assigned by the system automatically.
<name> Ц template name.
<format> Ц message format.
<sender> Ц sender ID.
<flag> Ц flag for the template. Setting the first bit of the flag (fl[1]=1) assigns the use of the template for auto-signing.
<message> Ц the text of the message.

The server does not accept more than three identical requests for actions with templates within a minute to reduce the load and protect against errors and loops in the Client-side program.

Managing operator templates

To manage service and transactional message templates, call the appropriate address with the required command and parameters using the GET or POST method.

To create a template (for all operators): https://smscentre.com/sys/op_templates.php?add=1&login=<login>&psw=<password>&sender=<sender>&msg=<msg>&mts_srv=1&mts_trn=1&mega_srv=1&mega_trn=1&bee_srv=1&bee_trn=1&tele2_srv=1&tele2_trn=1&soc=1
To get information about the template (for all operators): https://smscentre.com/sys/op_templates.php?get=1&login=<login>&psw=<password>&sender=<sender>&msg=<msg>
The following parameters are passed to the server:

OptionThe value
loginCustomer Login.
pswClient Password (you can add or change it on this page).
senderThe name of the sender for which the template is being created.
msgTemplate text.
charsetThe encoding of the template text, if used other than the default windows encoding-1251. Options: utf-8 and koi8-r.
mts_srvCreate a template for the MTS operator (service messages).
mts_trnCreate a template for the MTS operator (transactional messages).
mega_srvCreate a template for the Megafon operator (service (information) messages).
mega_authCreate a template for the Megafon operator (authorization messages).
mega_trnCreate a template for the Megafon operator (transactional messages).
bee_srvCreate a template for the Beeline operator (service messages).
bee_trnCreate a template for the Beeline operator (transactional messages).
tele2_srvCreate a template for the Tele2 operator (service messages).
tele2_trnCreate a template for the Tele2 operator (transactional messages).
socCreate a template for a soc message sent to users of the Odnoklassniki, VKontakte, or Mail.Ru Agent social networks".

If an error occurs, the Server returns the following string:
  • when fmt = 0:
    ERROR = N (description)

  • when fmt = 1:
    0,-N

  • when fmt = 2:
    <result>
    <error>description</error>
    <error_code>N</error_code>
    </result>

  • when fmt = 3:
    {
    "error": "description",
    "error_code": N
    }
N Ц error number, can take the following values:

The valueDescription
1Error in parameters.
2Invalid username or password. Also occurs when trying to send a message from an IP address that is not included in the list of allowed by the Client (if such a list was previously configured by the Client).
4The IP address is temporarily blocked.
9Attempt to send more than ten identical template action requests.
This error also occurs when you try to send fifteen or more requests simultaneously from different connections under the same username (too many concurrent requests).

If the request is successful, the Server returns a response in the form of a string:

When creating a template:
  • when fmt = 0:
    name = <status>, id = <id>
    ...

  • when fmt = 1:
    <name>,<status>,<id>
    ...

  • when fmt = 2:
    <result>
    <template>
    <name>name</name>
    <status>status</status>
    <id>id</id>
    </template>
    ...
    </result>

  • when fmt = 3:
    [{
    "name": <status>,
    "id": <id>
    },
    ...]

When requesting a list of templates:
  • when fmt = 0:
    name = <status>, id = <id>
    ...

  • when fmt = 1:
    <name>,<status>,<id>
    ...

  • when fmt = 2:
    <result>
    <template>
    <name>name</name>
    <status>status</status>
    <id>id</id>
    </template>
    ...
    </result>

  • when fmt = 3:
    [{
    "name": <status>,
    "id": <id>
    },
    ...]

Where:
<name> Ц operator name and message type.
<id> Ц template ID assigned by the system automatically.
<status> Ц the status of the template, can take the following values:

for the add command:
-2 Ц the specified template cannot be saved;
-1 Ц the sender name for this template was not found or was not accepted by the operator;
1 Ц template added successfully;

for the get command:
-1 Ц the template for the specified operator was not found;
0 Ц awaiting registration;
1 Ц sent for registration;
2 Ц accepted by the operator;
3 Ц not accepted by the operator;
4 Ц temporarily disabled.

The server does not accept more than ten identical requests for actions with templates within a minute to reduce the load and protect against errors and loops in the Client-side program.

Virtual sending (test mode)

This mode of operation allows you to test sending messages without actually transmitting them to operators. It can be useful for initial setup and testing of various software and hardware. To enable this mode, you need to go to your personal account under "Settings" in the drop-down block "API Settings", check the box "Test mode (virtual sending without payment)".

During virtual sending, all messages will have the final status "Delivered", but during the sending process, the messages will go through all the stages of processing along the chain "Waiting to be sent" Ц "Sent to the operator" Ц "Delivered". You can get message statuses either on request or on your own http handler. You can send both single messages and mass mailings. You can test different types of messages (SMS, binary messages, HLR, MMS, call), except for e-mail..

Event Notifications

When certain events occur, you may need to send notification messages containing the information necessary to process these events. To solve such problems, you can use the extension of our monitoring system, which allows you to send various notifications through our service from external systems. To do this, in your personal account on the page "Creating a task group" you need to create an appropriate group, where you can specify notification templates, types of messages sent when an event occurs, and contacts for notifications (phone numbers, e-mail addresses, jabber accounts).

To send a notification, you need to call the GET or POST address method: https://smscentre.com/sys/ping.php?login=<login>&psw=<password>&id=<id>
The following parameters are passed to the server:

OptionThe value
loginCustomer Login.
pswClient Password (you can add or change it on this page).
idID of the task group (the "ID" column").
nameThe name of the rule or server in the task. Replaces the {NAME} macro in the notification text.
hostThe address or IP of the server being checked. Replaces the {HOST} macro}.
infoAdditional information about the event. Replaces the macro {INFO}.
okWhen generating a notification, use the following template:
0 Ц (by default) a task group template is used, which is sent when a failure occurs.
1 Ц the task group template that is sent during recovery is used.

If an error occurs, the Server returns the following string:
  • ERROR = N (description)

  • When fmt = 1:
    0,-N

  • When fmt = 2:
    <result>
    <error>description</error>
    <error_code>N</error_code>
    </result>

  • When fmt = 3:
    {
    "error": "description",
    "error_code": N
    }
N Ц error number, can take the following values:

The valueDescription
1Error in parameters.
2Invalid username or password. Also occurs when trying to send a message from an IP address that is not included in the list of allowed by the Client (if such a list was previously configured by the Client).
3Task group not found.
4The IP address is temporarily blocked.
9Attempt to send more than five identical notification requests within a minute.
This error also occurs when you try to send fifteen or more requests simultaneously from different connections under the same username (too many concurrent requests).

If the request is successful, the Server returns a response in the form of a string.

  • when fmt = 0 and fmt = 1: OK

  • when fmt = 2:
    <result>OK</result>

  • when fmt = 3:
    {
    "result": "OK"
    }

The server does not accept more than five identical requests to send a notification within a minute to reduce the load and protect against errors and loops in the Client-side program.




© 2003Ц2023 SMS Center LLC
License no. 166255
support@smscentre.com
Contacts
Design Ч Artemy Lebedev Studio
Site Information
SMS Center for Android Yandex. Metrica