# Authentication

## login

<mark style="color:green;">`POST`</mark> `https://ventiapi.azurewebsites.net/login`

Generation of bearer token to be able to use the rest of the Ventiapp API functions.\
Once you do this authentication you can use the rest of the functions. To see how to make calls using the token, please go to the next post\
\
In the answer you will get the following values:\
\
**access\_token:** Token that you will use to call public functions. It is very important that you store this value.\
**token\_type**: Type of token used by the platform\
**expires\_in**: Time in seconds it will take for the token to expire (currently 1 week)\
\
These parameters should go as x-www-form-urlencoded

#### Request Body

| Name        | Type   | Description                                                                      |
| ----------- | ------ | -------------------------------------------------------------------------------- |
| username    | string | Email de acceso de cuenta con permisos de administrador                          |
| password    | string | Password de acceso de cuenta con permisos de administrador                       |
| grant\_type | string | Parámetro requerido con el valor "password" para poder realizar la autenticación |

{% tabs %}
{% tab title="200 Respuesta de solicitud de token" %}

```javascript
{
    "access_token": "V9e78myG5kPq_Kp8TAUhnJOnVvZEQ6rWS7IxbCD9dkxReYUSe_m4Sn5xjq2KF-XJhTIlQWvF9GIndhtDjx7WQr4CzYye1KLTNkJevRPNk2HR9cEULifFArxez8kA4evkRDke-4a3Gekdb_sDcQZXr6X1D4C7MeqyNAT0LjvqgLR-dFXdbNQrBkvIX_I6hsPzEAR0mjcxWRawVMfcq97vpPUAW42cZJD-AJbZdE9KVwUYgIhgO2M2IBZLrctLvl2xjx3OrQy9-Y_d---wUUDoWw",
    "token_type": "bearer",
    "expires_in": 604799
}

```

{% endtab %}
{% endtabs %}

Example of  **x-www-form-urlencoded**

```
username=hola@kubodigital.com&password=kubodigital&grant_type=password
```
