# Flash Calls - авторизация звонком

Запросы выполняются методом **POST** или **GET** на URL:

\*\*<https://api.telefon-ip.ru/api/v1/authcalls/{token}/{action}/{params**}> где:

**token** - ключ доступа к API, который можете получить в личном кабинете или по запросу на <support@telefon-ip.ru>. Первые 50 запросов для тестирования бесплатно.

**action** - вызываемые функции API описанные ниже в документации

**params** - передаваемые параметры в зависимости от метода вызова, обычно для GET запроса

***

## **get\_code** - получение кода авторизации

<mark style="color:green;">`GET`</mark> [`https://api.telefon-ip.ru/api/v1/authcalls/<token>/get_code/<phone>/`](https://api.telefon-ip.ru/api/v1/authcalls/<token>/get_code/<phone>/)

Осуществляет звонок на указанный номер телефона для проверки авторизации. Если указан параметр sms, то проверяется возможность дозвона. В случае неудачи отправляется sms код.

{% hint style="info" %}
Пример:

<https://api.telefon-ip.ru/api/v1/authcalls/4ea13fbf-f5a3-4084-8b01-9733cd6fd0b1/get\\_code/89243555100> <br>

Запрос с отправкой SMS в случае если звонок не был доставлен

\
<https://api.telefon-ip.ru/api/v1/authcalls/4ea13fbf-f5a3-4084-8b01-9733cd6fd0b1/get\\_code/89243555100?sms=true>
{% endhint %}

Path Parameters

| Name                                                              | Value  | Description                    |
| ----------------------------------------------------------------- | ------ | ------------------------------ |
| token\*                                                           | string | Ключ доступа                   |
| phone\*                                                           | string | <p>Номер вызываемого абонента. |
| <br>Ограничение на количество отправок в сутки по умолчанию 3</p> |        |                                |

Query Parameters

| Name  | Type    | Description                                                                                                                                                                                                                    |
| ----- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `sms` | boolean | <p><strong>true:</strong> если звонок не проходит и оператор возвращает код ошибки, на номер клиента автоматически отправляется SMS с кодом авторизации.</p><p><strong>false:</strong> по умолчанию эта функция отключена.</p> |

**Response**

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

```json
{
    "success": true,
    "error": "",
    "data": {
        "phone": "79244501003",
        "code": "1003",
        "id": 168
    }
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "success": false,
    "error": "does not match the format 89XXXXXXXXX or phone field is missing",
    "data": {}
}
```

{% endtab %}

{% tab title="401" %}

```json
{
    "success": false,
    "error": "Unauthorized token",
    "data": {}
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.telefon-ip.ru/reference/api-reference/flash-calls-avtorizaciya-zvonkom.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
