| Sending an SMS messageTo 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 :
Option | The value
|
---|
login | Customer Login.
|
---|
psw | Client Password (you can add or change it on this page).
|
---|
apikey | A special API key used for simplified authorization instead of the "login+password" pair (you can create it on this page).
|
---|
phones | The 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.
|
---|
mes | The 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
|
---|
id | The 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 ."-_".
|
---|
sender | The 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.
|
---|
translit | A 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".
|
---|
tinyurl | Automatically 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.
|
---|
time | The time of sending the SMS message to the subscriber.
Formats:
- DDMMYYhhmm or DD.MM.YY hh: mm.
- 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.
- 0ts, where ts is timestamp, the time in seconds since January 1, 1970.
- +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.
|
---|
tz | The 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.
|
---|
period | The 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.
|
---|
freq | The 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.
|
---|
flash | Indicates whether a Flash message is displayed immediately on the phone screen.
0 (default) – normal message. 1 – Flash message.
|
---|
bin | Binary 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.
|
---|
push | A 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.
|
---|
hlr | A 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.
|
---|
ping | Indicates 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.
|
---|
mms | A 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.
|
---|
mail | The 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.
|
---|
soc | A 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.
|
---|
viber | Flag of the viber message sent to users of the Viber messenger.
0 (default) – normal message. 1 – viber message.
|
---|
whatsapp | A sign of a whatsapp message sent to WhatsApp messenger users.
0 (default) – normal message. 1 – whatsapp message.
|
---|
tg | If the value of this parameter is set to 1, a telegram message will be sent with the confirmation code passed in the mes parameter.
|
---|
bot | Bot's name to for sending a message in the format "@botname_bot".
|
---|
smsreq | When 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.
|
---|
fileurl | The full http address of the file to upload and transmit in the message. The minimum file size is 101 bytes.
|
---|
call | Indicates 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.
|
---|
voice | The 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..
|
---|
param | Comma-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.
|
---|
subj | The 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.
|
---|
charset | The encoding of the transmitted message, if used other than the
default encoding of windows-1251. Options: utf-8 and koi8-r.
|
---|
cost | Indicates 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.
|
---|
fmt | Format 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.
|
---|
list | A 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.
|
---|
valid | The "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.
|
---|
maxsms | The 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.
|
---|
imgcode | The value of the alphanumeric code entered with "captcha" when using anti-spam verification.
This parameter must be used in conjunction with the userip parameter.
|
---|
userip | The 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".
|
---|
err | Indicates 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.
|
---|
op | Indicates 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..
|
---|
pp | Binds 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 value | Description
|
---|
1 | Error in parameters.
|
---|
2 | Invalid 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).
|
---|
3 | Insufficient funds on the Client's account.
|
---|
4 | IP address is temporarily blocked due to frequent errors in the queries. read More
|
---|
5 | Invalid date format.
|
---|
6 | The 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.
|
---|
7 | Invalid phone number format.
|
---|
8 | The message to the specified number can not be delivered.
|
---|
9 | Sending 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 messagesExamples:
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 |