Pricing plans  Services  API  Partners  About the service  Contacts 
8 (800) 700 7672
Free in Russia
 

Integration with the service (API)

The API allows you to send messages through your projects and services over the HTTP/HTTPS, SMTP, and SMPP protocols. Ready-made libraries in different programming languages connect to your project and help you send messages from anywhere with a single command.


HTTP/HTTPS SMTP SMPP SOAP OMS SMS Commands Libraries and code examples

SENDING MESSAGES

MANAGING MAILING LISTS

MESSAGE STATUSES

CHECKING THE BALANCE STATUS

CONTACT MANAGEMENT

CLIENT MANAGEMENT

MANAGING SENDER NAMES (SENDER ID)

GETTING DATA

VARIOUS

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,3,4,5,9 errors.
When fmt = 1:
  • 0,-N Ц for errors 1,2,3,4,5,9.
When fmt = 2:
  • For 1 errors,2,3,4,5,9:
    <result>
    <error>description</error>
    <error_code>N</error_code>
    </result>
When fmt = 3:
  • For 1 errors,2,3,4,5,9:
    {
    "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).
3Error saving a record.
4IP address is temporarily blocked due to frequent errors in the queries. read More
5Invalid date format.
9Sending more than one identical request for actions with mailing lists 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 creating a mailing list:
  • when cost = 0 and fmt = 0: OK, ID - <id>

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

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

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

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

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

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

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

When you disable or delete a mailing list:

  • when fmt = 0,1: OK

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

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

When receiving information about a specific mailing list (when mail=1, the "phones" parameter is replaced with " emails"):

  • when fmt = 0: <id>|<name>|<subject>|<repeat_send>|<repeat_cnt>|<created>|<changed>|<need_date>|<last_sent>|<phones>|<message>|<format>|<validity>|<period>|<frequency>|<status>|<sender_id>

  • when fmt = 1: <id>;<name>;<subject>;<repeat_send>;<repeat_cnt>;<created>;<changed>;<need_date>;<last_sent>;<phones>;<message>;<format>;<validity>;<period>;<frequency>;<status>;<sender_id>

  • when fmt = 2:
    <job>
    <id>id</id>
    <name>name</name>
    <subject>subject</subject>
    <repeat_send>repeat_send</repeat_send>
    <repeat_cnt>repeat_cnt</repeat_cnt>
    <created>created</created>
    <changed>changed</changed>
    <need_date>need_date</need_date>
    <last_sent>last_sent</last_sent>
    <phones>phones</phones>
    <message>message</message>
    <format>format</format>
    <validity>validity</validity>
    <period>period</period>
    <frequency>frequency</frequency>
    <status>status</status>
    <sender_id>sender_id</sender_id>
    </job>

  • when fmt = 3:
    [
    {
    "id": <id>,
    "name": "<name>",
    "subject": "<subject>",
    "repeat_send": <repeat_send>,
    "repeat_cnt": <repeat_cnt>,
    "created": "<created>",
    "changed": "<changed>",
    "need_date": "<need_date>",
    "last_sent": "<last_sent>",
    "phones": "<phones>",
    "message": "<message>",
    "format": <format>,
    "validity": <validity>,
    "period": "<period>",
    "frequency": <frequency>,
    "status": <status>,
    "cost": "<cost>",
    "sms_sent": <sms_sent>,
    "sms_ok": <sms_ok>,
    "sender_id": "<sender_id>"
    }
    ]


When receiving a mailing list (when mail=1, the "phones" parameter is replaced with " emails"):

  • when fmt = 0: <id>|<name>|<changed>|<need_date>|<last_sent>|<phones>|<message>|<phones_cnt>|<cost>|<status>|<sender_id>|<format>

  • when fmt = 1: <id>;<name>;<changed>;<need_date>;<last_sent>;<phones>;<message>;<phones_cnt>;<cost>;<status>;<sender_id>;<format>

  • when fmt = 2:
    <sms_jobs>
    <job>
    <id>id</id>
    <name>name</name>
    <changed>changed</changed>
    <need_date>need_date</need_date>
    <last_sent>last_sent</last_sent>
    <phones>phones</phones>
    <message>message</message>
    <phones_cnt>phones_cnt</phones_cnt>
    <cost>cost</cost>
    <status>status</status>
    <sender_id>sender_id</sender_id>
    <format>format</format>
    </job>
    ...
    </sms_jobs>

  • when fmt = 3:
    [
    {
    "id": <id>,
    "name": "<name>",
    "changed": "<changed>",
    "need_date": "<need_date>",
    "last_sent": "<last_sent>",
    "phones": "<phones>",
    "message": "<message>",
    "phones_cnt": <phones_cnt>,
    "cost": "<cost>",
    "status": <status>,
    "sender_id": "<sender_id>",
    "format": <format>,
    "sms_sent": <sms_sent>,
    "sms_ok": <sms_ok>
    },
    ...
    ]

Where:
<id> Ц the distribution ID sent by the Client or assigned by the Server automatically.
<name> Ц mailing list name.
<subject> Ц subject (for e-mail newsletters).
<repeat_send> Ц repeat period.
<repeat_cnt> Ц the number of repetitions of the mailing list.
<created> Ц mailing list creation date.
<changed> Ц date of mailing list change.
<need_date> Ц scheduled date of dispatch.
<last_sent> Ц last sent date.
<phones> (<emails>) Ц list of phone numbers (e-mail addresses) of message recipients.
<message> Ц the text of the message.
<format> Ц message format.
<validity> Ц "lifetime" of the message.
<period> Ц message sending interval.
<frequency> Ц frequency of sending messages.
<status> Ц mailing list status.
<sender_id> Ц sender ID.
<phones_cnt> Ц number of recipients.
<cost> Ц cost of sending.
<sms_sent> Ц number of messages sent.
<sms_ok> Ц number of messages delivered.



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