| SOAP ProtocolDescriptionWeb Service method description file: https://smscentre.com/sys/soap.php?wsdl
The service provides methods for sending messages and receiving the cost, checking the status and balance status..
All parameters must be passed in UTF-8 encoding.Sending a message
To send SMS messages, use the send_sms and send_sms2 methods.
In the send_sms2 method, you can add additional parameters.
$client = new SoapClient('https://smscentre.com/sys/soap.php?wsdl'); $ret = $client->send_sms(array('login'=>'alex', 'psw'=>'123', 'phones'=>'79999999999', 'mes'=>'Hello world!', 'id'=>'', 'sender'=>'ivan', 'time'=>0));
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.
|
---|
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.
|
---|
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.
|
---|
query | A string of additional parameters (only in send_sms2)
passed in the format: 'parameter_1=value_1¶meter_2=value_2'.
|
---|
Additional parameters passed to the 'query'
|
---|
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.
|
---|
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.
|
---|
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.
|
---|
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.
|
---|
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, passed in the errors parameter.
|
---|
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.
|
---|
Returned parameters:
The value | Description
|
---|
id | The message ID sent by the Client or assigned automatically by the Server.
|
---|
balance | New Customer Balance.
|
---|
cost | Cost of sending.
|
---|
cnt | The number of SMS sent, calculated as the number of SMS in the message multiplied by the number of recipients.
|
---|
error | Error code.
|
---|
The error code 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 in Customer account.
|
---|
4 | IP address is temporarily blocked due to frequent errors in the queries. read More
|
---|
5 | Invalid date format.
|
---|
6 | Denied message (by text or by sender name).
|
---|
7 | Invalid phone number format.
|
---|
8 | The message to the specified number can not be delivered.
|
---|
9 | Sending more than one identical request for the transmission of SMS messages within minutes.
|
---|
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 2 minutes, 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.
Getting the costTo get the SMS cost, you can use the get_sms_cost or get_sms_cost2 method.
It is possible to add additional parameters in get_sms_cost2.
$client = new SoapClient ('https://smscentre.com/sys/soap.php?wsdl'); $ret = $client->get_sms_cost(array('login'=>'alex', 'psw'=>'123', 'phones'=>'79999999999', 'mes'=>'Hello world!'));
The following parameters are 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 | Phone number.
|
---|
mes | Message ID.
|
---|
query | A string of additional parameters (only in get_sms_cost2)
passed in the format: 'parameter_1=value_1¶meter_2=value_2'.
For a detailed description of the parameters, see the description of the send_sms method.
|
---|
Returned parameters:
Option | The value
|
---|
cost | Mailing cost.
|
---|
cnt | The number of SMS sent, calculated as the number of SMS in the message multiplied by the number of recipients.
|
---|
error | Error code.
|
---|
Checking the status
To check the SMS delivery status, use the get_status and get_status2 methods.
In the get_status2 method, you can add additional parameters.
$client = new SoapClient ('https://smscentre.com/sys/soap.php?wsdl'); $ret = $client->get_status(array('login'=>'alex', 'psw'=>'123', 'phone'=>'79999999999', 'id'=>'999', 'all'=>'0'));
The following parameters are 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).
|
---|
phone | Phone number.
|
---|
id | Message ID.
|
---|
all | 0 – (by default) get the status of the message in the usual format.
1 – get full information about the sent message.
2 – add information about the operator and the subscriber's region to the message information.
|
---|
query | A string of additional parameters (only in get_status2)
passed in the format: 'parameter_1=value_1¶meter_2=value_2'.
|
---|
Returned parameters:
Option | The value
|
---|
status | Status Code (list).
|
---|
last_date | The date of the last status change. Format DD.MM.YYYY hh: mm: ss.
|
---|
err | Error code if the message cannot be delivered (list).
|
---|
error | Error code if the status cannot be requested.
|
---|
all = 1
|
---|
send_date | Date the message was sent (format DD.MM.YYYY hh: mm: ss).
|
---|
phone | Subscriber's phone number.
|
---|
cost | Message cost.
|
---|
sender_id | Sender ID.
|
---|
status_name | Status name.
|
---|
message | The text of the message.
|
---|
sms_cnt | Number of parts in an SMS message (or seconds in a voice message).
|
---|
all = 2
|
---|
operator | The name of the operator of the subscriber.
|
---|
region | Region of registration of the subscriber number.
|
---|
The error codecan 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 | Message not found.
|
---|
4 | The IP address is temporarily blocked.
|
---|
9 | Attempt to send more than five status requests for the same message within a minute.
|
---|
Checking the balance status
To request a balance, use the get_balance method.
$client = new SoapClient ('https://smscentre.com/sys/soap.php?wsdl'); $ret = $client->get_balance(array('login'=>'alex', 'psw'=>'123'));
The following parameters are 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).
|
---|
The response returns the current balance balance and the error number error.
The error number can take the following values:
The value | Description
|
---|
0 | There are no errors.
|
---|
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).
|
---|
4 | The IP address is temporarily blocked.
|
---|
9 | Attempt to send more than ten balance requests within a minute.
|
---|
|