# Sending SMS, Viber, Flash SMS, WAP-Push

## Sending SMS, Viber, Flash SMS, WAP-Push

<mark style="color:green;">`POST`</mark> `http://lk.mysmpp.ru/xml`

#### Headers

| Name                                           | Type   | Description                    |
| ---------------------------------------------- | ------ | ------------------------------ |
| Content-type<mark style="color:red;">\*</mark> | String | **`text/xml; charset=utf-8;`** |

#### Request Body

| Name                                                    | Type   | Description                                                                                                                                                                                                                                                                                            |
| ------------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| login.value<mark style="color:red;">\*</mark>           | String | Your login in the system                                                                                                                                                                                                                                                                               |
| message.address.region                                  | String | Area for vCard                                                                                                                                                                                                                                                                                         |
| message.address.city                                    | String | City for vCard                                                                                                                                                                                                                                                                                         |
| message.address.street                                  | String | Street for vCard                                                                                                                                                                                                                                                                                       |
| message.address.post\_office\_box                       | Int    | PO Box for vCard                                                                                                                                                                                                                                                                                       |
| message.organization                                    | String | Organization for vCard                                                                                                                                                                                                                                                                                 |
| message.position                                        | String | Contact's position for vCard                                                                                                                                                                                                                                                                           |
| message.email                                           | String | E-mail for vCard                                                                                                                                                                                                                                                                                       |
| message.phone.fax                                       | Int    | Fax number for vCard                                                                                                                                                                                                                                                                                   |
| message.phone.work                                      | Int    | Work phone number for vCard                                                                                                                                                                                                                                                                            |
| message.phone.cell                                      | Int    | Phone number for vCard                                                                                                                                                                                                                                                                                 |
| message.name                                            | String | Name for vCard                                                                                                                                                                                                                                                                                         |
| message.url                                             | String | Link for WAP Push or vCard                                                                                                                                                                                                                                                                             |
| message.abonent.time\_send                              | date   | <p>The date and time of the shipment in the format:</p><p>YYYY-MM-DD HH:MM</p><p>where,<br>   YYYY-year,<br>   MM-month,<br>   DD-day,<br>   HH-hours, </p><p>   MM-minutes</p><p><mark style="color:orange;">If not set, Viber message has maximum lifetime (one day</mark>).</p>                     |
| message.abonent.client\_id\_sms                         | String | <p>The number assigned by the client </p><p><mark style="color:orange;">Optional parameter, allows to avoid resending. If SMS with this number has already been sent from this account earlier, then it will not be sent again, but the number of the previously sent SMS will be returned.</mark></p> |
| message.abonent.number\_sms                             | Int    | Message number within the XML document being sent                                                                                                                                                                                                                                                      |
| message.image\_viber                                    | String | Address of the picture for Viber message                                                                                                                                                                                                                                                               |
| message.action\_viber                                   | String | Link for Viber message button                                                                                                                                                                                                                                                                          |
| message.button\_viber                                   | String | Viber message button text                                                                                                                                                                                                                                                                              |
| message.text\_viber<mark style="color:red;">\*</mark>   | String | Viber message text                                                                                                                                                                                                                                                                                     |
| message.sender\_viber<mark style="color:red;">\*</mark> | String | Viber message sender                                                                                                                                                                                                                                                                                   |
| message.type                                            | String | <p>SMS message type:</p><p>- flashsms - Flash SMS</p><p>- silence - invisible SMS (to check subscriber status)</p><p>- sms - regular SMS</p><p>- wappush - WAP-Push</p><p>- vcard - business card (vCard)</p>                                                                                          |
| message.type\_send\_2                                   | String | Type of message to be delivered, in case the message to be sent is not delivered (**`viber`** or **`sms`**)                                                                                                                                                                                            |
| message.type\_send\_1<mark style="color:red;">\*</mark> | String | Type of message to be sent (**`viber`** or **`sms`**)                                                                                                                                                                                                                                                  |
| token.value<mark style="color:red;">\*</mark>           | String | You can use a secret key instead of login and password. To obtain it, please contact your manager                                                                                                                                                                                                      |
| password.value<mark style="color:red;">\*</mark>        | String | Your password in the system                                                                                                                                                                                                                                                                            |
| message.sender<mark style="color:red;">\*</mark>        | String | <p>Sender of SMS message </p><p><mark style="color:red;">This is the value that will be displayed on the subscriber's phone in the SMS From field.</mark></p>                                                                                                                                          |
| message.text<mark style="color:red;">\*</mark>          | String | SMS text                                                                                                                                                                                                                                                                                               |
| abonent.phone<mark style="color:red;">\*</mark>         | Int    | Number of the subscriber to whom the SMS is addressed                                                                                                                                                                                                                                                  |
| message.additional                                      | String | Additional information for vCard                                                                                                                                                                                                                                                                       |
| message.address.country                                 | String | Country for vCard                                                                                                                                                                                                                                                                                      |
| message.address.postal\_code                            | Int    | Index for vCard                                                                                                                                                                                                                                                                                        |

{% tabs %}
{% tab title="200: OK If a valid XML document is received" %}

```xml
<?xml  version="1.0" encoding="utf-8" ?>
<response>
     <information number_sms="1" id_sms="SMS ID in the system to check the status" parts="2">Status/error message</information>
     <information number_sms="2" id_sms="SMS ID in the system to check the status" parts="2">Status/error message</information>
     <information number_sms="3" id_sms="SMS ID in the system to check the status" parts="2">Status/error message</information>
…
</response>
```

{% endtab %}

{% tab title="400: Bad Request If an error occurs in the sent XML document" %}

```xml
<?xml version="1.0" encoding="utf-8"?>
<response>
     <error>Error message</error>
</response>
```

{% endtab %}
{% endtabs %}

### Deciphering parameters in query responses

<table><thead><tr><th width="174.33333333333331">Parameter</th><th width="149">Data type</th><th>Description</th></tr></thead><tbody><tr><td>information.number_sms</td><td>Int</td><td>The message number specified when sending the XML document</td></tr><tr><td>information.id_sms</td><td>Int</td><td><p>SMS message number. It is used to check the status of SMS. </p><p><mark style="color:orange;">If an error occurred while sending SMS, id_sms is</mark> <mark style="color:orange;">not transmitted</mark></p></td></tr><tr><td>information.parts</td><td>Int</td><td>Number of SMS parts</td></tr><tr><td>information</td><td>String</td><td><p>Message status ("send") if SMS has been sent, or an error message if an error occurred while sending SMS: </p><ul><li>We have run out of SMS. Please contact your manager to resolve the problem </li><li>Out of SMS </li><li>Account blocked </li><li>Specify phone number </li><li>Phone number is on the stop list </li><li>This destination is closed for you </li><li>This destination is closed </li><li>SMS text rejected by moderator </li><li>No sender </li><li>The sender must not exceed 15 characters for numeric numbers and 11 characters for alphanumeric numbers </li><li>Phone number must be less than 15 characters </li><li>No message text </li><li>No link </li><li>Provide the contact name and at least one parameter for a business card </li><li>There is no such sender </li><li>The sender has not been moderated</li></ul></td></tr><tr><td>error</td><td>String</td><td><p>The error text can take the following values:</p><ul><li>Incorrect XML document format </li><li>Incorrect login or password </li><li>POST data is missing</li></ul></td></tr></tbody></table>

### Example XML request

```xml
<?xml version="1.0" encoding="utf-8" ?>
<request>
  <message type_send_1="viber or sms" type_send_2="viber or sms" type="flashsms or silence or sms or wappush or vcard">
   <sender_viber>Sender of Viber message</sender_viber>
   <text_viber>Message text</text_viber>
   <button_viber>Button text</button_viber>
   <action_viber>Link for button</action_viber>
   <image_viber>Address of image</image_viber>
   <sender>Sender 1</sender>
   <text>Message text 1</text>
   <url>Address for WAP Push or vCard</url>
   <name>Name for vCard</name>
   <phone cell="79033256699" work="79033256699" fax="79033256699"/>
   <email>E-mail vCard</email>
   <position>Job vCard</position>
   <organization>Organization vCard</organization>
   <address post_office_box="P.O. Box" street="Street" city="City" region="Region" postal_code="Index" country="Country" />
   <additional>Additional vCard information</additional>
   <abonent phone="79033256699" number_sms="1" client_id_sms="101" time_send="2001-12-31 12:34:54" validity_period="2001-12-31 15:34:54" validity_period_viber="2001-12-31 15:34:54" />
   <abonent phone="79033256699" number_sms="2" client_id_sms="102" time_send="2001-12-31 12:35:54" />
     ...
   <abonent phone="79033256699" number_sms="10" client_id_sms="110" time_send="" />
 </message>
 <message>
   <sender>Sender 2</sender>
   <text>Message Text 2</text>
   <abonent phone="79033256699" number_sms="11" client_id_sms="111" />
   <abonent phone="79033256699" number_sms="12" client_id_sms="112" />.
   ...
   <abonent phone="79033256699" number_sms="20" client_id_sms="120" />
</сообщение
 ...
<security>
   <login value="login" />
   <password value="password" />
</security>
</request>
```
