# Login

## Realizar Login

<mark style="color:green;">`POST`</mark> `https://sol.interfoneip.com/auth/app`

Necessário para receber o token

#### Request Body

| Name  | Type   | Description        |
| ----- | ------ | ------------------ |
| login | string | Telefone ou E-Mail |

{% tabs %}
{% tab title="200 O retorno "type" depende do que foi enviado pelo  login, se foi um e-mail ou um telefone (Para saber onde vai receber o código)" %}

```javascript
{
    "message": "Success",
    "type": "M"
}
```

{% endtab %}

{% tab title="404 " %}

```javascript
{
    "error": "User not found!"
}
```

{% endtab %}
{% endtabs %}

## Confirmar Token

<mark style="color:green;">`POST`</mark> `https://sol.interfoneip.com/auth/app/token`

Validar o token recebido pelo endpoint anterior

#### Request Body

| Name         | Type   | Description                                          |
| ------------ | ------ | ---------------------------------------------------- |
| token        | string | Código de 4 dígitos recebido pelo telefone ou e-mail |
| login        | string | Telefone ou E-mail fornecido no endpoint anterior    |
| mac\_address | string | Mac Adress do dispositivo a conectar                 |

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

```javascript
{
    "token": "XXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXX"
}
```

{% endtab %}

{% tab title="401 " %}

```javascript
{
    "error": "Access Denied!"
}
```

{% endtab %}
{% endtabs %}

## Validar Token

<mark style="color:green;">`POST`</mark> `https://sol.interfoneip.com`

#### Headers

| Name           | Type   | Description      |
| -------------- | ------ | ---------------- |
| Authentication | string | Bearer JWT Token |

#### Request Body

| Name         | Type   | Description                                |
| ------------ | ------ | ------------------------------------------ |
| token        | string | Token JWT Fornecido pelo endpoint anterior |
| mac\_address | string | Mac Address do dispositivo conectado       |

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

```
```

{% endtab %}
{% endtabs %}

## Realizar login (Site)

<mark style="color:green;">`POST`</mark> `https://sol.interfoneip.com/auth`

O token adquirido precisa ser fornecido via Authorization para todas as solicitações seguintes

#### Request Body

| Name            | Type    | Description                      |
| --------------- | ------- | -------------------------------- |
| manterConectado | boolean | Manter conectado por mais tempo  |
| login           | string  | Usuário (login, telefone, email) |
| senha           | string  | Senha                            |

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

```javascript
{
    "token": "eyJ0eXAiOiJKsadLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJsdW1lbi1qd3QiLCJzdWIiOjksrhdhgdCI6MTU3MTAwMjE2MCwiZXhwIjoxNTcxMDMwOTYwfQ.zi-eCTkunyJYkPu023fqkkkBBeKNDVHBEeesjPkuQFA"
}
```

{% endtab %}

{% tab title="403 " %}

```
{
    "error": "Login or password is wrong."
}
```

{% 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://devdocs.atendeai.com/master.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.
