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

MESSAGES SENDING

MANAGING MAILING LISTS

MESSAGE STATUSES

CHECKING THE BALANCE STATUS

MANAGING CONTACTS

CLIENT MANAGEMENT

MANAGING SENDER NAMES (SENDER ID)

GETTING DATA

VARIOUS

Messages sending

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
To send an SMS with the transmission of parameters in json format in the request body, you must use the POST method to call the address: https://smscentre.com/rest/send/
Description of the parameters passed to the Server :

OptionThe value
loginCustomer Login.
pswClient Password (you can add or change it on this page).
apikeyA special API key used for simplified authorization instead of the "login+password" pair (you can create 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. For telegram, it is possible to specify the subscriber's nickname or ID as the recipient of the message in the form of #ID.
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.
tgIf the value of this parameter is set to 1, a telegram message will be sent with the confirmation code passed in the mes parameter.
botBot's name to for sending a message in the format "@botname_bot".
smsreqWhen this parameter is specified, the system will not display the text of the message sent to the user and display a warning about the need to confirm the phone number if more than smsreq days have passed since the last confirmation. Range of values from 10 to 999.
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 (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..
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).
When specifying the value of any parameter other than the possible ones, the default values of all parameters will be used (n = 8, w = 25, i from 3 to 14 seconds incrementally), except for advertising messages.
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 encoding of windows-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 (works only for requests in which the time parameter is represented as DDMMYYhhmm or DD.MM.YY hh:mm)) 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 receiving and processing the data, the Server returns a 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..

Sending messages. 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 an SMS message.
<status> – sMS Message status code.
<error> – error code in the status.

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 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 an HLR request

You can check phone numbers for availability by sending a special HLR request. As a result of executing the request, data will be received about the subscriber's country and operator, about the roaming operator when the subscriber is on someone else's network, as well as about the subscriber's status (available or not). Subscribers, owners of the numbers being checked, will not receive any notifications about the checks performed on 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 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
Sending an e-mail with the subject "Holiday" and two photos via the cURL-based library:

<?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"));
?>

Sending an e-mail with the subject "Hello" and a photo uploaded earlier 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 (by default).
  • voice = m4 – male voice 4.
  • voice = w – a woman's voice.
  • voice = w2 – female voice 2.
  • voice = w3 – female voice 3.
  • voice = 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..

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's handler, to which information about the current item and the time of the subscriber's stay 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 the 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 handset of 20 seconds, a repeat interval of 10 seconds and the number of dial attempts 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

File Transfer

Sending an image, document file, or video in a message is possible in one of the following ways:
  • â âèäå ïîëíîãî http(s)-àäðåñà âíåøíåãî ôàéëà, óêàçàííîãî â òåêñòå ñîîáùåíèÿ, â ôîðìàòå <file http(s)://...> (only for images and document files);
  • by the POST method in the body of the http(s) request to the server. With this method of sending, the attached files must be designated in the message text in a special way in the form of "<file n>", where n is the file number in the generated list starting from one;
  • by adding a special additional fileurl parameter to http(s), containing the full http(s) address of the transmitted external file. When using fileurl, passing the mes parameter in the request is optional;
  • when sending from your personal account or via the API, insert the full http(s) link of the previously downloaded file into the message text, which can be found in your personal account on the sending page by clicking sequentially "attach file" – "Downloaded files".
The attached file must not exceed 1 MB in size (for API) or 10 MB (for personal account) and satisfy one of the following formats:
  • jpg, jpeg, gif, png – for pictures;
  • doc, docx, rtf, dotx, dot, odf, fodt, odt, txt, info, pdf, xps, eps, pdax, xlsx, xlsm, fods, ods, csv, xltx – for document files;
  • 3gp, m4v, mov, mp4 – for the video.

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.
  • Text+ button – the subscriber receives a text message, under which the button is located. When you click on the button, you click on the specified link.
  • Text + button + picture – the subscriber receives a text message, under which the picture and the button are located. When you click on the button, you click on the specified link.
  • Only a file – a file of one of the supported formats is transmitted to the subscriber.
  • Picture +video – the subscriber receives a video file, the screensaver of which is the transmitted picture.
  • Text+picture+video – the subscriber receives a video file with a splash picture and the specified text.
  • Text+picture+video+button – the subscriber receives a video file with a splash picture, the specified text and a button. When you click on the button, you click on the specified 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 through 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
Sending a viber message with the text "Video and button", the button "{button,http://smscentre.com,smsc button}", the picture "http://smscentre.com/upload/files/sms/123456/1.png" and the video "http://smscentre.com/upload/files/sms/123456/1.mp4":

https://smscentre.com/sys/send.php?login=alex&psw=123&phones=79999999999&viber=1&mes=%C2%E8%E4%E5%EE+%E8+%EA%ED%EE%EF%EA%E0+http%3A%2F%2Fsmscentre.com%2Fupload%2Ffiles%2Fsms%2F123456%2F1.png%0Ahttp%3A%2F%2Fsmscentre.com%2Fupload%2Ffiles%2Fsms%2F123456%2F1.mp4%0A%7Bbutton%2Chttp%3A%2F%2Fsmscentre.com%2C%CA%ED%EE%EF%EA%E0+smsc%7D

Sending a message to Telegram

To send the confirmation code to Telegram, you need to call the GET or POST address method: https://smscentre.com/sys/send.php?login=<login>&psw=<password>&phones=<phones>&mes=<message>&tg=1
Only numeric codes with a length from 4 to 8 digits are accepted for sending.

Examples of sending messages to Telegram

Examples:

Sending the confirmation code "123456" to the number "79999999999" in telegram:

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

Sending a message to the Telegram chatbot

To send a message to the Telegram chatbot, you need to call the GET or POST address method: https://smscentre.com/sys/send.php?login=<login>&psw=<password>&phones=<phones>&mes=<message>&bot=<@botname_bot>

Examples of sending messages to the Telegram chatbot

Examples:

Sending a message with the text "Hello" to the number "79999999999" in the telegram bot "@mybot_bot":

https://smscentre.com/sys/send.php?login=alex&psw=123&phones=79999999999&mes=Hello&bot=@mybot_bot
Sending a message with the text "Hello" by the nickname "alex_nick" to the telegram bot "@mybot_bot":

https://smscentre.com/sys/send.php?login=alex&psw=123&phones=@alex_nick&mes=Hello&bot=@mybot_bot
Sending a message with the text "Hi" by ID 1122334455 to the telegram bot "@mybot_bot":

https://smscentre.com/sys/send.php?login=alex&psw=123&phones=#1122334455&mes=Hi&bot=@mybot_bot
Sending a message with the text "Hello" to the number "79999999999" in the telegram bot "@mybot_bot" with an indication in the smsreq parameter of the number of days after which it will be necessary to confirm the phone number with an SMS code:

https://smscentre.com/sys/send.php?login=alex&psw=123&phones=79999999999&mes=Privet&bot=@mybot_bot&smsreq=25

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, you can specify a special combination "\n~~~\n" at the end of the text (line feed, 3 of the tilde character and line feed again), after which you pass the param parameter that defines some characteristics of the call (for more details, 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. You can read more about the process of creating a voice message on this page.
__VIBER__: messageSending a message to Viber messenger users.
__SOC__: message Sending a message to users of the social networks "Odnoklassniki", "VKontakte" or users of " Mail.Ru Agent".
__MAIL__: message Sending an E-mail message.
__BOT__: message Sending a message to Telegram chatbot users.
__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__A sign of an HLR request to receive 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 an HLR request:

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).
apikeyA special API key used for simplified authorization instead of the "login+password" pair (you can create 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).
3The record was 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> – the 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 templates for service, transactional, and other templated messages, you must call the appropriate address using the GET or POST method, specifying the required command and parameters.

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_auth=1&mts_trn=1&mega_srv=1&mega_auth=1&mega_trn=1&mega_adv=1&bee_srv=1&bee_trn=1&tele2_srv=1&tele2_trn=1&motiv_srv=1&motiv_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).
apikeyA special API key used for simplified authorization instead of the "login+password" pair (you can create 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_authCreate a template for the MTS operator (authorization messages).
mts_trnCreate a template for the MTS operator (transactional messages).
mega_advCreate a template for the Megafon operator (advertising template 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).
motiv_srvCreate a template for the MOTIVE operator (service messages).
motiv_trnCreate a template for the MOTIVE 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> – the name of the operator and the type of messages.
<id> – the 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 in the process of sending the message, all stages of processing will take place along the chain "Waiting to be sent" – "Transmitted to the operator" – "Delivered". You can receive message statuses both on request and on your http handler. You can send both single messages and mass mailings. It is possible to test various types of messages (SMS, binary messages, HLR, call) during virtual sending, 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).
apikeyA special API key used for simplified authorization instead of the "login+password" pair (you can create 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 {INFO} macro.
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–2024 SMS Center LLC
support@smscentre.com
Contacts
Design — Artemy Lebedev Studio
Site Information
SMS Center for Android Yandex. Metrica