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