# Request for obtaining the list of bases

## Request for obtaining the list of bases

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

#### 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                                                                          |
| 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                                                                       |

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

```xml
<?xml version="1.0" encoding="utf-8" ?>
<response>
     <base id_base="1234" name_base="Head Office Base" time_birth="12:48" local_time_birth="yes" day_before="1 "originator_birth="fitnes" on_birth="yes">Congratulations!"</base>
     <base id_base="1235" name_base="BaseMoscowoffice" time_birth="12:48" local_time_birth="yes" day_before="1 "originator_birth="fitnes" on_birth="yes">Congratulations!</base>
...
</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="162.33333333333331">Parameter</th><th width="163">Data type</th><th>Description</th></tr></thead><tbody><tr><td>base</td><td>String</td><td>Congratulations text</td></tr><tr><td>base.id_base</td><td>Int</td><td>Unique base number in the system</td></tr><tr><td>base.name_base</td><td>String</td><td>Base name</td></tr><tr><td>base.time_birth</td><td>Int</td><td>Greeting time</td></tr><tr><td>base.local_time_birth</td><td>String</td><td>Read the greeting time in relation to the local time of the subscriber (<strong><code>yes</code></strong>) or in relation to the system time (<strong><code>no</code></strong>)</td></tr><tr><td>base.day_before</td><td>Int</td><td>How many days before your birthday to congratulate</td></tr><tr><td>base.originator_birth</td><td>String</td><td>Sender of congratulations</td></tr><tr><td>base.on_birth</td><td>String</td><td><p>Whether congratulations are enabled: </p><ul><li>yes - enabled </li><li>no - off</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>
     <security>
          <login value="login" />
          <password value="password" />
     </security>
</request>
```
