# Request for receiving the list of subscribers of the base

## Request for receiving the list of subscribers of the base

<mark style="color:green;">`POST`</mark> `http://lk.mysmpp.ru/xml/list_phones.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                                                                                                                                                             |
| base.last\_update                                | Int    | Minimum date and time of registration (or last change) of the subscriber data you need to request                                                                                    |
| base.page<mark style="color:red;">\*</mark>      | Int    | Page number. The entire list of base numbers is divided into pages. You cannot request the entire database. You can only request an individual page. The numbering starts with a one |
| base.id\_base<mark style="color:red;">\*</mark>  | Int    | Base number 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>
     <phones page="1" num_pages="100">
          <phone phone="79612242243" region="Novosibirsk " operator="Vimpelcom" name="Konstantin" surname="Ermolaev" patronymic="Alexandrovich" date_birth="1984-08-21" male="m" addition_1="First-additional-field" addition_2="second" last_update=" 2011-03-25 08:39:48"/>
          <phone phone="79612242244" region="Novosibirsk " operator="Vimpelcom" name="Konstantin" surname="Ermolaev" patronymic="Aleksandrovich" date_birth="1984-08-21" male="m" addition_1="First-additional-field" addition_2="second" last_update=" 2011-03-25 08:39:48" />
...
     </phones>
</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="167.33333333333331">Parameter</th><th width="154">Data type</th><th>Description</th></tr></thead><tbody><tr><td>phones.page</td><td>Int</td><td>Page number</td></tr><tr><td>phones.num_pages</td><td>Int</td><td>Total pages</td></tr><tr><td>phones.phone.phone</td><td>Int</td><td>Subscriber's phone number</td></tr><tr><td>phones.phone.region</td><td>String</td><td>Region</td></tr><tr><td>phones.phone.operator</td><td>String</td><td>Operator</td></tr><tr><td>phones.phone.name</td><td>String</td><td>Subscriber Name</td></tr><tr><td>phones.phone.surname</td><td>String</td><td>Subscriber's last name</td></tr><tr><td>phones.phone.patronymic</td><td>String</td><td>Subscriber's patronymic</td></tr><tr><td>phones.phone.date_birth</td><td>Int</td><td>Date of birth</td></tr><tr><td>phones.phone.male</td><td>String</td><td><p>Gender: </p><ul><li>"f"-female </li><li>"m" is masculine</li></ul></td></tr><tr><td>phones.phone.addition_1</td><td>String</td><td>First additional field</td></tr><tr><td>phones.phone.addition_2</td><td>String</td><td>Second additional field</td></tr><tr><td>phones.phone.last_update</td><td>Int</td><td>Date and time of registration (or last change) of subscriber data</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>
    <base id_base="1234" page=”1” last_update=”2011-03-25 08:39:48”/>
</request>
```
