# API для экспорта

Данный API предоставляет доступ к результатам анализа звонков, выполненного системой **aiokk**. С его помощью вы можете экспортировать структурированные данные по звонкам в формате JSON и использовать их для интеграции, отчётности или анализа в сторонних системах (CRM, BI, Excel и др.).

Система позволяет гибко фильтровать звонки по различным признакам, включая:

1. **Отделы** — фильтрация по названию конкретного подразделения или направления внутри компании.
2. **Операторы** — отбор звонков по имени (ФИО) сотрудника, который обработал звонок.
3. **Тип звонка** — классификация по направлению звонка:
   * Исходящий - 1&#x20;
   * Входящий - 2
   * Входящие с перенаправлением - 3&#x20;
   * Обратный звонок - 4
4. **Критерий оценки** — звонки, в которых применялся определённый скрипт/сценарий, созданный клиентом. Фильтрация производится по ID набора вопросов.
5. **Оценка удовлетворенности клиента (1–10)** — позволяет выбрать звонки, в которых аналитика дала числовую оценку удовлетворённости или лояльности клиента. Укажите значение от 1 до 10 для фильтрации.
6. **Сигналы (маяки)** — наличие ключевых слов и фраз, заранее настроенных в системе (фильтрация производится по самим ключевым словам).

### Методы API

1\) Получить результаты анализа звонков по **Отделам**

<mark style="color:green;">`POST`</mark> `/api/v1/export/dialogs/department`

**Headers**

| Name         | Value              |
| ------------ | ------------------ |
| Content-Type | `application/json` |

**Body**

| Name           | Type    | Description                                                                     |
| -------------- | ------- | ------------------------------------------------------------------------------- |
| token          | string  | Токен вы можете получить в своем кабинете aiokk на страницы "Экспорт через API" |
| department\_id | integer | ID департамента в вашей системе                                                 |

**Response**

{% tabs %}
{% tab title="200" %}

```json
[
    {
        "call": {
            "dialogId": 1138,
            "created_at": "2025-04-21T07:06:15.000000Z",
            "callerId": "+7 (777) 777 77 77",
            "callerIdClean": "7777777777",
            "callType": 1,
            "date": "2025-04-21 12:06:15+05",
            "durationSec": 64,
            "durationMin": 2
        },
        "operator": {
            "operatorId": 4,
            "fullName": "Иван Иванович",
            "intNum": 594,
            "departmentId": "84",
            "departmentName": "Отдел продаж"
        },
        "analytics": {
            "status": 3,
            "price": 150,
            "finishDate": "2025-04-18T11:59:56",
            "summary": "The conversation began with greetings from both the operator and the customer. The customer quickly expressed frustration over perceived misunderstandings, accusing the operator of not grasping their concerns, and asserted that their problem was not being addressed. Phrases such as 'вы должны понять это ваша проблема' and 'вы не понимаете' indicated the customer's dissatisfaction with the operator's responses. The operator attempted to communicate service limitations but struggled to gain the customer's trust or convey clarity. The dialogue revealed a high level of tension, with raised voices and accusations from the customer about the operator's competence.",
            "languages": [
                "ru"
            ],
            "clientLoyalty": {
                "currentGrade": 2,
                "description": "The customer expressed frustration throughout the conversation, indicating a lack of understanding and perceived lack of attention from the operator. Phrasing like 'вы ничего не понимаете' and 'вы неадекватны' suggests high dissatisfaction with the service. The operator's handling of inquiries was ineffective, leading to a strained interaction.",
                "recommendation": "Implement a follow-up communication that clarifies the service terms and assures the customer of support. Additionally, consider training on empathy techniques and effective communication strategies for handling frustrated customers."
            },
            "evaluationCriteria": {
                "evaluationId": 27,
                "evaluationTitle": "Вопросы по умолчанию",
                "eCurrentGrade": 31,
                "maxGrade": 100,
                "evaluationRecommendation": "To enhance the quality of service, operators should receive training on active listening and managing difficult conversations. Implementing a script that guides operators on how to validate customer emotions without escalating conflict can also help in future interactions.",
                "criterion1": {
                    "description1": "Although the operator greeted the customer politely, the overall tone quickly turned negative due to the operator's inability to address the customer's concerns effectively.",
                    "mark1": 3
                },
                "criterion2": {
                    "description2": "The operator struggled to communicate effectively, leading to confusion rather than clarity in addressing the customer's issues.",
                    "mark2": 4
                },
                "criterion3": {
                    "description3": "The operator did not demonstrate effective listening skills, interrupting the customer multiple times and failing to acknowledge their frustrations adequately.",
                    "mark3": 2
                },
                "criterion4": {
                    "description4": "The operator's attempts to address the customer's problem were inefficient, resulting in an unresolved situation that heightened customer dissatisfaction.",
                    "mark4": 3
                },
                "criterion5": {
                    "description5": "The operator did not show initiative or offer any additional support to help resolve the customer's problems during the interaction.",
                    "mark5": 1
                },
                "criterion6": {
                    "description6": "Professional language was used, but the delivery was overshadowed by the overall negative tone of the conversation.",
                    "mark6": 5
                },
                "criterion7": {
                    "description7": "The operator's speech was not consistently calm, especially when the customer became agitated, leading to an escalation in conflict.",
                    "mark7": 3
                },
                "criterion8": {
                    "description8": "While the operator followed company standards in greetings and protocols, adherence faltered under pressure from the customer's frustrations.",
                    "mark8": 5
                },
                "criterion9": {
                    "description9": "The customer was clearly unhappy with the interaction, emphasizing their dissatisfaction and escalating the conversation with complaints.",
                    "mark9": 2
                },
                "criterion10": {
                    "description10": "Overall service quality was poor due to ineffective communication, lack of listening skills, and insufficient resolution of the customer's issues.",
                    "mark10": 3
                }
            },
            "signals": {
                "signalsTitle": "сенсата, стоп слова",
                "count": 24,
                "mentionedSignals": "вам не подходит, у вас недостаточно средств, не перебиваете, вы не понимаете, блин, может быть, мы не можем снизить цену, гарантируем сто процентов, вы должны понять, послушайте меня, не кричите, вы кто вообще, а вы кто, почему вы кричите, почему вы так выражаетесь, зачем вы так говорите, вы ничего не понимаете, вы же не знаете, вы вышли из себя, вы не адекватны, вы ведете себя странно, некорректно, агрессивно, это ваша проблема"
            },
            "markers": []
        }
    },
    ...
]
```

{% endtab %}

{% tab title="402" %}

```json
{
  "error": "API not paid",
  "code": "Your API subscription has expired or not been paid."
}

{
  "error": "API not paid",
  "code": "Payment for API access is required. Please complete the payment to continue."
}
```

{% endtab %}

{% tab title="403" %}

```json
{
  "error": "API functionality is disabled",
  "message": "The requested API functionality has been disabled. Please contact support for more details."
}
```

{% endtab %}

{% tab title="404" %}

```json
{
  "error": "Token not found",
  "message": "The access token is missing or invalid. Please provide a valid token to authenticate the request."
}
```

{% endtab %}

{% tab title="502" %}

```
// Сервис не доступен
```

{% endtab %}
{% endtabs %}

2\) Получить результаты анализа звонков по **ФИО оператора**

<mark style="color:green;">`POST`</mark> `/api/v1/export/dialogs/operator`

**Headers**

| Name         | Value              |
| ------------ | ------------------ |
| Content-Type | `application/json` |

**Body**

| Name           | Type   | Description                                                                     |
| -------------- | ------ | ------------------------------------------------------------------------------- |
| token          | string | Токен вы можете получить в своем кабинете aiokk на страницы "Экспорт через API" |
| operator\_name | string | ФИО оператора (Иван)                                                            |

**Response**

{% tabs %}
{% tab title="200" %}

```json
[
    {
        "call": {
            "dialogId": 1138,
            "created_at": "2025-04-21T07:06:15.000000Z",
            "callerId": "+7 (777) 777 77 77",
            "callerIdClean": "7777777777",
            "callType": 1,
            "date": "2025-04-21 12:06:15+05",
            "durationSec": 64,
            "durationMin": 2
        },
        "operator": {
            "operatorId": 4,
            "fullName": "Иван Иванович",
            "intNum": 594,
            "departmentId": "84",
            "departmentName": "Отдел продаж"
        },
        "analytics": {
            "status": 3,
            "price": 150,
            "finishDate": "2025-04-18T11:59:56",
            "summary": "The conversation began with greetings from both the operator and the customer. The customer quickly expressed frustration over perceived misunderstandings, accusing the operator of not grasping their concerns, and asserted that their problem was not being addressed. Phrases such as 'вы должны понять это ваша проблема' and 'вы не понимаете' indicated the customer's dissatisfaction with the operator's responses. The operator attempted to communicate service limitations but struggled to gain the customer's trust or convey clarity. The dialogue revealed a high level of tension, with raised voices and accusations from the customer about the operator's competence.",
            "languages": [
                "ru"
            ],
            "clientLoyalty": {
                "currentGrade": 2,
                "description": "The customer expressed frustration throughout the conversation, indicating a lack of understanding and perceived lack of attention from the operator. Phrasing like 'вы ничего не понимаете' and 'вы неадекватны' suggests high dissatisfaction with the service. The operator's handling of inquiries was ineffective, leading to a strained interaction.",
                "recommendation": "Implement a follow-up communication that clarifies the service terms and assures the customer of support. Additionally, consider training on empathy techniques and effective communication strategies for handling frustrated customers."
            },
            "evaluationCriteria": {
                "evaluationId": 27,
                "evaluationTitle": "Вопросы по умолчанию",
                "eCurrentGrade": 31,
                "maxGrade": 100,
                "evaluationRecommendation": "To enhance the quality of service, operators should receive training on active listening and managing difficult conversations. Implementing a script that guides operators on how to validate customer emotions without escalating conflict can also help in future interactions.",
                "criterion1": {
                    "description1": "Although the operator greeted the customer politely, the overall tone quickly turned negative due to the operator's inability to address the customer's concerns effectively.",
                    "mark1": 3
                },
                "criterion2": {
                    "description2": "The operator struggled to communicate effectively, leading to confusion rather than clarity in addressing the customer's issues.",
                    "mark2": 4
                },
                "criterion3": {
                    "description3": "The operator did not demonstrate effective listening skills, interrupting the customer multiple times and failing to acknowledge their frustrations adequately.",
                    "mark3": 2
                },
                "criterion4": {
                    "description4": "The operator's attempts to address the customer's problem were inefficient, resulting in an unresolved situation that heightened customer dissatisfaction.",
                    "mark4": 3
                },
                "criterion5": {
                    "description5": "The operator did not show initiative or offer any additional support to help resolve the customer's problems during the interaction.",
                    "mark5": 1
                },
                "criterion6": {
                    "description6": "Professional language was used, but the delivery was overshadowed by the overall negative tone of the conversation.",
                    "mark6": 5
                },
                "criterion7": {
                    "description7": "The operator's speech was not consistently calm, especially when the customer became agitated, leading to an escalation in conflict.",
                    "mark7": 3
                },
                "criterion8": {
                    "description8": "While the operator followed company standards in greetings and protocols, adherence faltered under pressure from the customer's frustrations.",
                    "mark8": 5
                },
                "criterion9": {
                    "description9": "The customer was clearly unhappy with the interaction, emphasizing their dissatisfaction and escalating the conversation with complaints.",
                    "mark9": 2
                },
                "criterion10": {
                    "description10": "Overall service quality was poor due to ineffective communication, lack of listening skills, and insufficient resolution of the customer's issues.",
                    "mark10": 3
                }
            },
            "signals": {
                "signalsTitle": "сенсата, стоп слова",
                "count": 24,
                "mentionedSignals": "вам не подходит, у вас недостаточно средств, не перебиваете, вы не понимаете, блин, может быть, мы не можем снизить цену, гарантируем сто процентов, вы должны понять, послушайте меня, не кричите, вы кто вообще, а вы кто, почему вы кричите, почему вы так выражаетесь, зачем вы так говорите, вы ничего не понимаете, вы же не знаете, вы вышли из себя, вы не адекватны, вы ведете себя странно, некорректно, агрессивно, это ваша проблема"
            },
            "markers": []
        }
    },
    ...
]
```

{% endtab %}

{% tab title="402" %}

```json
{
  "error": "API not paid",
  "code": "Your API subscription has expired or not been paid."
}

{
  "error": "API not paid",
  "code": "Payment for API access is required. Please complete the payment to continue."
}
```

{% endtab %}

{% tab title="403" %}

```json
{
  "error": "API functionality is disabled",
  "message": "The requested API functionality has been disabled. Please contact support for more details."
}
```

{% endtab %}

{% tab title="404" %}

```json
{
  "error": "Token not found",
  "message": "The access token is missing or invalid. Please provide a valid token to authenticate the request."
}
```

{% endtab %}

{% tab title="502" %}

```
// Сервис не доступен
```

{% endtab %}
{% endtabs %}

3\) Получить результаты анализа звонков по **Типу звонка**

<mark style="color:green;">`POST`</mark> `/api/v1/export/dialogs/call_type`

**Headers**

| Name         | Value              |
| ------------ | ------------------ |
| Content-Type | `application/json` |

**Body**

| Name       | Type    | Description                                                                                               |
| ---------- | ------- | --------------------------------------------------------------------------------------------------------- |
| token      | string  | Токен вы можете получить в своем кабинете aiokk на страницы "Экспорт через API"                           |
| call\_type | integer | <p>Исходящий - 1 </p><p>Входящий - 2</p><p>Входящие с перенаправлением - 3 </p><p>Обратный звонок - 4</p> |

**Response**

{% tabs %}
{% tab title="200" %}

```json
[
    {
        "call": {
            "dialogId": 1138,
            "created_at": "2025-04-21T07:06:15.000000Z",
            "callerId": "+7 (777) 777 77 77",
            "callerIdClean": "7777777777",
            "callType": 1,
            "date": "2025-04-21 12:06:15+05",
            "durationSec": 64,
            "durationMin": 2
        },
        "operator": {
            "operatorId": 4,
            "fullName": "Иван Иванович",
            "intNum": 594,
            "departmentId": "84",
            "departmentName": "Отдел продаж"
        },
        "analytics": {
            "status": 3,
            "price": 150,
            "finishDate": "2025-04-18T11:59:56",
            "summary": "The conversation began with greetings from both the operator and the customer. The customer quickly expressed frustration over perceived misunderstandings, accusing the operator of not grasping their concerns, and asserted that their problem was not being addressed. Phrases such as 'вы должны понять это ваша проблема' and 'вы не понимаете' indicated the customer's dissatisfaction with the operator's responses. The operator attempted to communicate service limitations but struggled to gain the customer's trust or convey clarity. The dialogue revealed a high level of tension, with raised voices and accusations from the customer about the operator's competence.",
            "languages": [
                "ru"
            ],
            "clientLoyalty": {
                "currentGrade": 2,
                "description": "The customer expressed frustration throughout the conversation, indicating a lack of understanding and perceived lack of attention from the operator. Phrasing like 'вы ничего не понимаете' and 'вы неадекватны' suggests high dissatisfaction with the service. The operator's handling of inquiries was ineffective, leading to a strained interaction.",
                "recommendation": "Implement a follow-up communication that clarifies the service terms and assures the customer of support. Additionally, consider training on empathy techniques and effective communication strategies for handling frustrated customers."
            },
            "evaluationCriteria": {
                "evaluationId": 27,
                "evaluationTitle": "Вопросы по умолчанию",
                "eCurrentGrade": 31,
                "maxGrade": 100,
                "evaluationRecommendation": "To enhance the quality of service, operators should receive training on active listening and managing difficult conversations. Implementing a script that guides operators on how to validate customer emotions without escalating conflict can also help in future interactions.",
                "criterion1": {
                    "description1": "Although the operator greeted the customer politely, the overall tone quickly turned negative due to the operator's inability to address the customer's concerns effectively.",
                    "mark1": 3
                },
                "criterion2": {
                    "description2": "The operator struggled to communicate effectively, leading to confusion rather than clarity in addressing the customer's issues.",
                    "mark2": 4
                },
                "criterion3": {
                    "description3": "The operator did not demonstrate effective listening skills, interrupting the customer multiple times and failing to acknowledge their frustrations adequately.",
                    "mark3": 2
                },
                "criterion4": {
                    "description4": "The operator's attempts to address the customer's problem were inefficient, resulting in an unresolved situation that heightened customer dissatisfaction.",
                    "mark4": 3
                },
                "criterion5": {
                    "description5": "The operator did not show initiative or offer any additional support to help resolve the customer's problems during the interaction.",
                    "mark5": 1
                },
                "criterion6": {
                    "description6": "Professional language was used, but the delivery was overshadowed by the overall negative tone of the conversation.",
                    "mark6": 5
                },
                "criterion7": {
                    "description7": "The operator's speech was not consistently calm, especially when the customer became agitated, leading to an escalation in conflict.",
                    "mark7": 3
                },
                "criterion8": {
                    "description8": "While the operator followed company standards in greetings and protocols, adherence faltered under pressure from the customer's frustrations.",
                    "mark8": 5
                },
                "criterion9": {
                    "description9": "The customer was clearly unhappy with the interaction, emphasizing their dissatisfaction and escalating the conversation with complaints.",
                    "mark9": 2
                },
                "criterion10": {
                    "description10": "Overall service quality was poor due to ineffective communication, lack of listening skills, and insufficient resolution of the customer's issues.",
                    "mark10": 3
                }
            },
            "signals": {
                "signalsTitle": "сенсата, стоп слова",
                "count": 24,
                "mentionedSignals": "вам не подходит, у вас недостаточно средств, не перебиваете, вы не понимаете, блин, может быть, мы не можем снизить цену, гарантируем сто процентов, вы должны понять, послушайте меня, не кричите, вы кто вообще, а вы кто, почему вы кричите, почему вы так выражаетесь, зачем вы так говорите, вы ничего не понимаете, вы же не знаете, вы вышли из себя, вы не адекватны, вы ведете себя странно, некорректно, агрессивно, это ваша проблема"
            },
            "markers": []
        }
    },
    ...
]
```

{% endtab %}

{% tab title="402" %}

```json
{
  "error": "API not paid",
  "code": "Your API subscription has expired or not been paid."
}

{
  "error": "API not paid",
  "code": "Payment for API access is required. Please complete the payment to continue."
}
```

{% endtab %}

{% tab title="403" %}

```json
{
  "error": "API functionality is disabled",
  "message": "The requested API functionality has been disabled. Please contact support for more details."
}
```

{% endtab %}

{% tab title="404" %}

```json
{
  "error": "Token not found",
  "message": "The access token is missing or invalid. Please provide a valid token to authenticate the request."
}
```

{% endtab %}

{% tab title="502" %}

```
// Сервис не доступен
```

{% endtab %}
{% endtabs %}

4\) Получить результаты анализа звонков по ID набора **Критерия оценки**

<mark style="color:green;">`POST`</mark> `/api/v1/export/dialogs/question_pack`

**Headers**

| Name         | Value              |
| ------------ | ------------------ |
| Content-Type | `application/json` |

**Body**

| Name   | Type    | Description                                                                     |
| ------ | ------- | ------------------------------------------------------------------------------- |
| token  | string  | Токен вы можете получить в своем кабинете aiokk на страницы "Экспорт через API" |
| qp\_id | integer | ID набора **критерия оценки**, можно получить на странице "Критерии оценки"     |

**Response**

{% tabs %}
{% tab title="200" %}

```json
[
    {
        "call": {
            "dialogId": 1138,
            "created_at": "2025-04-21T07:06:15.000000Z",
            "callerId": "+7 (777) 777 77 77",
            "callerIdClean": "7777777777",
            "callType": 1,
            "date": "2025-04-21 12:06:15+05",
            "durationSec": 64,
            "durationMin": 2
        },
        "operator": {
            "operatorId": 4,
            "fullName": "Иван Иванович",
            "intNum": 594,
            "departmentId": "84",
            "departmentName": "Отдел продаж"
        },
        "analytics": {
            "status": 3,
            "price": 150,
            "finishDate": "2025-04-18T11:59:56",
            "summary": "The conversation began with greetings from both the operator and the customer. The customer quickly expressed frustration over perceived misunderstandings, accusing the operator of not grasping their concerns, and asserted that their problem was not being addressed. Phrases such as 'вы должны понять это ваша проблема' and 'вы не понимаете' indicated the customer's dissatisfaction with the operator's responses. The operator attempted to communicate service limitations but struggled to gain the customer's trust or convey clarity. The dialogue revealed a high level of tension, with raised voices and accusations from the customer about the operator's competence.",
            "languages": [
                "ru"
            ],
            "clientLoyalty": {
                "currentGrade": 2,
                "description": "The customer expressed frustration throughout the conversation, indicating a lack of understanding and perceived lack of attention from the operator. Phrasing like 'вы ничего не понимаете' and 'вы неадекватны' suggests high dissatisfaction with the service. The operator's handling of inquiries was ineffective, leading to a strained interaction.",
                "recommendation": "Implement a follow-up communication that clarifies the service terms and assures the customer of support. Additionally, consider training on empathy techniques and effective communication strategies for handling frustrated customers."
            },
            "evaluationCriteria": {
                "evaluationId": 27,
                "evaluationTitle": "Вопросы по умолчанию",
                "eCurrentGrade": 31,
                "maxGrade": 100,
                "evaluationRecommendation": "To enhance the quality of service, operators should receive training on active listening and managing difficult conversations. Implementing a script that guides operators on how to validate customer emotions without escalating conflict can also help in future interactions.",
                "criterion1": {
                    "description1": "Although the operator greeted the customer politely, the overall tone quickly turned negative due to the operator's inability to address the customer's concerns effectively.",
                    "mark1": 3
                },
                "criterion2": {
                    "description2": "The operator struggled to communicate effectively, leading to confusion rather than clarity in addressing the customer's issues.",
                    "mark2": 4
                },
                "criterion3": {
                    "description3": "The operator did not demonstrate effective listening skills, interrupting the customer multiple times and failing to acknowledge their frustrations adequately.",
                    "mark3": 2
                },
                "criterion4": {
                    "description4": "The operator's attempts to address the customer's problem were inefficient, resulting in an unresolved situation that heightened customer dissatisfaction.",
                    "mark4": 3
                },
                "criterion5": {
                    "description5": "The operator did not show initiative or offer any additional support to help resolve the customer's problems during the interaction.",
                    "mark5": 1
                },
                "criterion6": {
                    "description6": "Professional language was used, but the delivery was overshadowed by the overall negative tone of the conversation.",
                    "mark6": 5
                },
                "criterion7": {
                    "description7": "The operator's speech was not consistently calm, especially when the customer became agitated, leading to an escalation in conflict.",
                    "mark7": 3
                },
                "criterion8": {
                    "description8": "While the operator followed company standards in greetings and protocols, adherence faltered under pressure from the customer's frustrations.",
                    "mark8": 5
                },
                "criterion9": {
                    "description9": "The customer was clearly unhappy with the interaction, emphasizing their dissatisfaction and escalating the conversation with complaints.",
                    "mark9": 2
                },
                "criterion10": {
                    "description10": "Overall service quality was poor due to ineffective communication, lack of listening skills, and insufficient resolution of the customer's issues.",
                    "mark10": 3
                }
            },
            "signals": {
                "signalsTitle": "сенсата, стоп слова",
                "count": 24,
                "mentionedSignals": "вам не подходит, у вас недостаточно средств, не перебиваете, вы не понимаете, блин, может быть, мы не можем снизить цену, гарантируем сто процентов, вы должны понять, послушайте меня, не кричите, вы кто вообще, а вы кто, почему вы кричите, почему вы так выражаетесь, зачем вы так говорите, вы ничего не понимаете, вы же не знаете, вы вышли из себя, вы не адекватны, вы ведете себя странно, некорректно, агрессивно, это ваша проблема"
            },
            "markers": []
        }
    },
    ...
]
```

{% endtab %}

{% tab title="402" %}

```json
{
  "error": "API not paid",
  "code": "Your API subscription has expired or not been paid."
}

{
  "error": "API not paid",
  "code": "Payment for API access is required. Please complete the payment to continue."
}
```

{% endtab %}

{% tab title="403" %}

```json
{
  "error": "API functionality is disabled",
  "message": "The requested API functionality has been disabled. Please contact support for more details."
}
```

{% endtab %}

{% tab title="404" %}

```json
{
  "error": "Token not found",
  "message": "The access token is missing or invalid. Please provide a valid token to authenticate the request."
}
```

{% endtab %}

{% tab title="502" %}

```
// Сервис не доступен
```

{% endtab %}
{% endtabs %}

5\) Получить результаты анализа звонков по **Оценки удовлетворенности клиента**

<mark style="color:green;">`POST`</mark> `/api/v1/export/dialogs/client_loyalty`

**Headers**

| Name         | Value              |
| ------------ | ------------------ |
| Content-Type | `application/json` |

**Body**

| Name            | Type    | Description                                                                     |
| --------------- | ------- | ------------------------------------------------------------------------------- |
| token           | string  | Токен вы можете получить в своем кабинете aiokk на страницы "Экспорт через API" |
| client\_loyalty | integer | <p>Введите любое значение от</p><p>1-10</p>                                     |

**Response**

{% tabs %}
{% tab title="200" %}

```json
[
    {
        "call": {
            "dialogId": 1138,
            "created_at": "2025-04-21T07:06:15.000000Z",
            "callerId": "+7 (777) 777 77 77",
            "callerIdClean": "7777777777",
            "callType": 1,
            "date": "2025-04-21 12:06:15+05",
            "durationSec": 64,
            "durationMin": 2
        },
        "operator": {
            "operatorId": 4,
            "fullName": "Иван Иванович",
            "intNum": 594,
            "departmentId": "84",
            "departmentName": "Отдел продаж"
        },
        "analytics": {
            "status": 3,
            "price": 150,
            "finishDate": "2025-04-18T11:59:56",
            "summary": "The conversation began with greetings from both the operator and the customer. The customer quickly expressed frustration over perceived misunderstandings, accusing the operator of not grasping their concerns, and asserted that their problem was not being addressed. Phrases such as 'вы должны понять это ваша проблема' and 'вы не понимаете' indicated the customer's dissatisfaction with the operator's responses. The operator attempted to communicate service limitations but struggled to gain the customer's trust or convey clarity. The dialogue revealed a high level of tension, with raised voices and accusations from the customer about the operator's competence.",
            "languages": [
                "ru"
            ],
            "clientLoyalty": {
                "currentGrade": 2,
                "description": "The customer expressed frustration throughout the conversation, indicating a lack of understanding and perceived lack of attention from the operator. Phrasing like 'вы ничего не понимаете' and 'вы неадекватны' suggests high dissatisfaction with the service. The operator's handling of inquiries was ineffective, leading to a strained interaction.",
                "recommendation": "Implement a follow-up communication that clarifies the service terms and assures the customer of support. Additionally, consider training on empathy techniques and effective communication strategies for handling frustrated customers."
            },
            "evaluationCriteria": {
                "evaluationId": 27,
                "evaluationTitle": "Вопросы по умолчанию",
                "eCurrentGrade": 31,
                "maxGrade": 100,
                "evaluationRecommendation": "To enhance the quality of service, operators should receive training on active listening and managing difficult conversations. Implementing a script that guides operators on how to validate customer emotions without escalating conflict can also help in future interactions.",
                "criterion1": {
                    "description1": "Although the operator greeted the customer politely, the overall tone quickly turned negative due to the operator's inability to address the customer's concerns effectively.",
                    "mark1": 3
                },
                "criterion2": {
                    "description2": "The operator struggled to communicate effectively, leading to confusion rather than clarity in addressing the customer's issues.",
                    "mark2": 4
                },
                "criterion3": {
                    "description3": "The operator did not demonstrate effective listening skills, interrupting the customer multiple times and failing to acknowledge their frustrations adequately.",
                    "mark3": 2
                },
                "criterion4": {
                    "description4": "The operator's attempts to address the customer's problem were inefficient, resulting in an unresolved situation that heightened customer dissatisfaction.",
                    "mark4": 3
                },
                "criterion5": {
                    "description5": "The operator did not show initiative or offer any additional support to help resolve the customer's problems during the interaction.",
                    "mark5": 1
                },
                "criterion6": {
                    "description6": "Professional language was used, but the delivery was overshadowed by the overall negative tone of the conversation.",
                    "mark6": 5
                },
                "criterion7": {
                    "description7": "The operator's speech was not consistently calm, especially when the customer became agitated, leading to an escalation in conflict.",
                    "mark7": 3
                },
                "criterion8": {
                    "description8": "While the operator followed company standards in greetings and protocols, adherence faltered under pressure from the customer's frustrations.",
                    "mark8": 5
                },
                "criterion9": {
                    "description9": "The customer was clearly unhappy with the interaction, emphasizing their dissatisfaction and escalating the conversation with complaints.",
                    "mark9": 2
                },
                "criterion10": {
                    "description10": "Overall service quality was poor due to ineffective communication, lack of listening skills, and insufficient resolution of the customer's issues.",
                    "mark10": 3
                }
            },
            "signals": {
                "signalsTitle": "сенсата, стоп слова",
                "count": 24,
                "mentionedSignals": "вам не подходит, у вас недостаточно средств, не перебиваете, вы не понимаете, блин, может быть, мы не можем снизить цену, гарантируем сто процентов, вы должны понять, послушайте меня, не кричите, вы кто вообще, а вы кто, почему вы кричите, почему вы так выражаетесь, зачем вы так говорите, вы ничего не понимаете, вы же не знаете, вы вышли из себя, вы не адекватны, вы ведете себя странно, некорректно, агрессивно, это ваша проблема"
            },
            "markers": []
        }
    },
    ...
]
```

{% endtab %}

{% tab title="402" %}

```json
{
  "error": "API not paid",
  "code": "Your API subscription has expired or not been paid."
}

{
  "error": "API not paid",
  "code": "Payment for API access is required. Please complete the payment to continue."
}
```

{% endtab %}

{% tab title="403" %}

```json
{
  "error": "API functionality is disabled",
  "message": "The requested API functionality has been disabled. Please contact support for more details."
}
```

{% endtab %}

{% tab title="404" %}

```json
{
  "error": "Token not found",
  "message": "The access token is missing or invalid. Please provide a valid token to authenticate the request."
}
```

{% endtab %}

{% tab title="502" %}

```
// Сервис не доступен
```

{% endtab %}
{% endtabs %}

6\) Получить результаты анализа звонков по **Сигналам (маяки)**

<mark style="color:green;">`POST`</mark> `/api/v1/export/dialogs/signals`

**Headers**

| Name         | Value              |
| ------------ | ------------------ |
| Content-Type | `application/json` |

**Body**

| Name         | Type    | Description                                                                     |
| ------------ | ------- | ------------------------------------------------------------------------------- |
| token        | string  | Токен вы можете получить в своем кабинете aiokk на страницы "Экспорт через API" |
| signal\_word | integer | Введите любое слова из пакета маяков (Пример: дорого)                           |

**Response**

{% tabs %}
{% tab title="200" %}

```json
[
    {
        "call": {
            "dialogId": 1138,
            "created_at": "2025-04-21T07:06:15.000000Z",
            "callerId": "+7 (777) 777 77 77",
            "callerIdClean": "7777777777",
            "callType": 1,
            "date": "2025-04-21 12:06:15+05",
            "durationSec": 64,
            "durationMin": 2
        },
        "operator": {
            "operatorId": 4,
            "fullName": "Иван Иванович",
            "intNum": 594,
            "departmentId": "84",
            "departmentName": "Отдел продаж"
        },
        "analytics": {
            "status": 3,
            "price": 150,
            "finishDate": "2025-04-18T11:59:56",
            "summary": "The conversation began with greetings from both the operator and the customer. The customer quickly expressed frustration over perceived misunderstandings, accusing the operator of not grasping their concerns, and asserted that their problem was not being addressed. Phrases such as 'вы должны понять это ваша проблема' and 'вы не понимаете' indicated the customer's dissatisfaction with the operator's responses. The operator attempted to communicate service limitations but struggled to gain the customer's trust or convey clarity. The dialogue revealed a high level of tension, with raised voices and accusations from the customer about the operator's competence.",
            "languages": [
                "ru"
            ],
            "clientLoyalty": {
                "currentGrade": 2,
                "description": "The customer expressed frustration throughout the conversation, indicating a lack of understanding and perceived lack of attention from the operator. Phrasing like 'вы ничего не понимаете' and 'вы неадекватны' suggests high dissatisfaction with the service. The operator's handling of inquiries was ineffective, leading to a strained interaction.",
                "recommendation": "Implement a follow-up communication that clarifies the service terms and assures the customer of support. Additionally, consider training on empathy techniques and effective communication strategies for handling frustrated customers."
            },
            "evaluationCriteria": {
                "evaluationId": 27,
                "evaluationTitle": "Вопросы по умолчанию",
                "eCurrentGrade": 31,
                "maxGrade": 100,
                "evaluationRecommendation": "To enhance the quality of service, operators should receive training on active listening and managing difficult conversations. Implementing a script that guides operators on how to validate customer emotions without escalating conflict can also help in future interactions.",
                "criterion1": {
                    "description1": "Although the operator greeted the customer politely, the overall tone quickly turned negative due to the operator's inability to address the customer's concerns effectively.",
                    "mark1": 3
                },
                "criterion2": {
                    "description2": "The operator struggled to communicate effectively, leading to confusion rather than clarity in addressing the customer's issues.",
                    "mark2": 4
                },
                "criterion3": {
                    "description3": "The operator did not demonstrate effective listening skills, interrupting the customer multiple times and failing to acknowledge their frustrations adequately.",
                    "mark3": 2
                },
                "criterion4": {
                    "description4": "The operator's attempts to address the customer's problem were inefficient, resulting in an unresolved situation that heightened customer dissatisfaction.",
                    "mark4": 3
                },
                "criterion5": {
                    "description5": "The operator did not show initiative or offer any additional support to help resolve the customer's problems during the interaction.",
                    "mark5": 1
                },
                "criterion6": {
                    "description6": "Professional language was used, but the delivery was overshadowed by the overall negative tone of the conversation.",
                    "mark6": 5
                },
                "criterion7": {
                    "description7": "The operator's speech was not consistently calm, especially when the customer became agitated, leading to an escalation in conflict.",
                    "mark7": 3
                },
                "criterion8": {
                    "description8": "While the operator followed company standards in greetings and protocols, adherence faltered under pressure from the customer's frustrations.",
                    "mark8": 5
                },
                "criterion9": {
                    "description9": "The customer was clearly unhappy with the interaction, emphasizing their dissatisfaction and escalating the conversation with complaints.",
                    "mark9": 2
                },
                "criterion10": {
                    "description10": "Overall service quality was poor due to ineffective communication, lack of listening skills, and insufficient resolution of the customer's issues.",
                    "mark10": 3
                }
            },
            "signals": {
                "signalsTitle": "сенсата, стоп слова",
                "count": 24,
                "mentionedSignals": "вам не подходит, у вас недостаточно средств, не перебиваете, вы не понимаете, блин, может быть, мы не можем снизить цену, гарантируем сто процентов, вы должны понять, послушайте меня, не кричите, вы кто вообще, а вы кто, почему вы кричите, почему вы так выражаетесь, зачем вы так говорите, вы ничего не понимаете, вы же не знаете, вы вышли из себя, вы не адекватны, вы ведете себя странно, некорректно, агрессивно, это ваша проблема"
            },
            "markers": []
        }
    },
    ...
]
```

{% endtab %}

{% tab title="402" %}

```json
{
  "error": "API not paid",
  "code": "Your API subscription has expired or not been paid."
}

{
  "error": "API not paid",
  "code": "Payment for API access is required. Please complete the payment to continue."
}
```

{% endtab %}

{% tab title="403" %}

```json
{
  "error": "API functionality is disabled",
  "message": "The requested API functionality has been disabled. Please contact support for more details."
}
```

{% endtab %}

{% tab title="404" %}

```json
{
  "error": "Token not found",
  "message": "The access token is missing or invalid. Please provide a valid token to authenticate the request."
}
```

{% endtab %}

{% tab title="502" %}

```
// Сервис не доступен
```

{% endtab %}
{% endtabs %}

Данный API предоставляет доступ к результатам анализа звонков, выполненного системой **aiokk**. С его помощью вы можете экспортировать структурированные данные по звонкам в формате JSON и использовать их для интеграции, отчётности или анализа в сторонних системах (CRM, BI, Excel и др.).

Система позволяет гибко фильтровать звонки по различным признакам, включая:

1. **Отделы** — фильтрация по названию конкретного подразделения или направления внутри компании..
2. **Операторы** — отбор звонков по имени (ФИО) сотрудника, который обработал звонок.
3. **Portal Number** — фильтрация по номеру телефона, через который поступил звонок (актуально при использовании нескольких SIP-номеров).
4. **Тип звонка** — классификация по направлению звонка:
   * Исходящий - 1&#x20;
   * Входящий - 2
   * Входящие с перенаправлением - 3&#x20;
   * Обратный звонок - 4
5. **Набор вопросов** — звонки, в которых применялся определённый скрипт/сценарий, созданный клиентом. Фильтрация производится по ID набора вопросов.
6. **Оценка клиента (1–10)** — позволяет выбрать звонки, в которых аналитика дала числовую оценку удовлетворённости или лояльности клиента. Укажите значение от 1 до 10 для фильтрации.
7. **Сигналы (маяки)** — наличие ключевых слов и фраз, заранее настроенных в системе (фильтрация производится по самим ключевым словам).

API защищён авторизацией через токен и поддерживает фильтрацию, пагинацию, ограничение по дате
