# Пошук співробітників компанії POST /api/external/company/employees/search

##### **REQUEST**

<div class="wy-table-responsive" id="bkmrk-url-%D0%9C%D0%B5%D1%82%D0%BE%D0%B4-%D0%B7%D0%B0%D0%BF%D0%B8%D1%82%D1%83-get"><table class="colwidths-given docutils align-default" style="width: 78.6905%; height: 296px;"><colgroup><col style="width: 25.5983%;"></col><col style="width: 74.3714%;"></col></colgroup><tbody><tr class="row-odd" style="height: 29.6px;"><td style="height: 29.6px;">**URL**

</td><td style="height: 29.6px;">  
</td></tr><tr class="row-even" style="height: 29.6px;"><td style="height: 29.6px;">Метод запиту

</td><td style="height: 29.6px;">POST

</td></tr><tr class="row-odd" style="height: 29.6px;"><td style="height: 29.6px;">URL запиту

</td><td style="height: 29.6px;">**/api/external/company/employees/search**

</td></tr><tr class="row-even" style="height: 29.6px;"><td style="height: 29.6px;">URL параметри

</td><td style="height: 29.6px;">**companyCode** (обов’язково) - код Компанії;

</td></tr><tr style="height: 29.6px;"><td style="height: 29.6px;">**Authorization**

</td><td style="height: 29.6px;">  
</td></tr><tr style="height: 29.6px;"><td style="height: 29.6px;">Auth type

</td><td style="height: 29.6px;">API key</td></tr><tr style="height: 29.6px;"><td style="height: 29.6px;">Key / Value

</td><td style="height: 29.6px;">**x-system-id** - токен, отриманий при підключенні</td></tr><tr class="row-odd" style="height: 29.6px;"><td style="height: 29.6px;">**Headers**

</td><td style="height: 29.6px;"> </td></tr><tr class="row-odd" style="height: 29.6px;"><td style="height: 29.6px;">Content-Type

</td><td style="height: 29.6px;">application/json

</td></tr><tr style="height: 29.6px;"><td>**REQUEST**

</td><td> </td></tr><tr><td>JSON Body

</td><td>В тілі запиту методу передається об’єкт [ESSUsersQuery](https://wiki-v2.edin.ua/books/robota-z-api-portalu-edin-id/page/objekt-essusersquery)

 **JSON приклад запиту:**

```json
{
  "search": "3148615913",
  "role": ["USER", "ADMIN"],
  "identification": ["YES"],
  "employeeStatus": ["ACTIVE"],
  "limit": {
    "offset": 0,
    "count": 20
  }
}
```

</td></tr></tbody></table>

</div>##### **RESPONSE**

В тілі відповіді передаються статус 200 та масив об'єктів [ESSUser](https://wiki-v2.edin.ua/books/robota-z-api-portalu-edin-id/page/objekt-essuser).

**JSON  приклад відповіді:**

```json
[
  {
    "id": 456,
    "login": "380501112233",
    "email": "employee@example.com",
    "fullName": "Іваненко Іван Іванович",
    "ipn": "3148615913",
    "identified": "YES",
    "role": "USER",
    "employeeStatus": "ACTIVE",
    "employeeEmail": "employee@example.com"
  }
]
```

##### **CURL** 

```
curl -X POST 'https://host/api/external/company/employees/search?...' \
  -H 'x-system-id: 019eb581-307b-7562-8a1f-20227511e898' \
  -H 'Content-Type: application/json' \
  -d '{
    "search": "3148615913",
    "employeeStatus": ["ACTIVE"],
    "limit": {"offset": 0, "count": 20}
  }'
```

##### **Помилки** 

<div class="c_tableWrapper__a48" id="bkmrk-http-type-%D0%9E%D0%BF%D0%B8%D1%81-403-a"><table style="width: 65.5952%;"><thead><tr><th style="width: 12.1951%;">HTTP</th><th style="width: 41.3678%;"><code>type</code></th><th style="width: 46.3893%;">Опис</th></tr></thead><tbody><tr><td style="width: 12.1951%;">403</td><td style="width: 41.3678%;"><code>company&#95;access&#95;denied</code></td><td style="width: 46.3893%;">Немає доступу до company.</td></tr></tbody></table>

</div>