# Authentification

## Get "id\_token" (Authorization)

<mark style="color:green;">`POST`</mark> `https://auth.transiteo.io/oauth2/token`

This endpoint allows you to get the "id\_token" thanks to the "client\_id" & "refresh\_token"

#### Headers

| Name         | Type   | Description                       |
| ------------ | ------ | --------------------------------- |
| content-type | string | application/x-www-form-urlencoded |

#### Request Body

| Name           | Type   | Description           |
| -------------- | ------ | --------------------- |
| client\_id     | string | "your client\_id"     |
| grant\_type    | string | refresh\_token        |
| refresh\_token | string | "your refresh\_token" |

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

```
{
    "id_token": string,
    "access_token": string,
    "expires_in": number,
    "token_type": string
}
```

{% endtab %}

{% tab title="400 " %}

```
{
    "error": "invalid_grant"
}
```

{% endtab %}
{% endtabs %}

### Response fields

```
{
    "id_token": "your id_token",
    "access_token": "your access_token",
    "expires_in": 3600,
    "token_type": "Bearer"
}
```

#### "*id\_token*"

***Examples :** "eyJraWQiOiI4eXVTYUd5WHNEUCtIOTU0UjYxd1Z4QkMyNHUydzRUclF5NEZ..."*\
\&#xNAN;***Type :** string*

#### "access\_token"

***Examples :** "eyJraWQiOiJNUHE3ZFJydk1FaTZqRXB1cGdsa1BhN3ZuV0dWWE94MjJTY..."*\
\&#xNAN;***Type :** string*

#### "expire\_in"

*The id-token and access\_token will expire in 3 600 seconds*\
***Value :** "3600"*\
\&#xNAN;***Type :** number*

#### "*token\_type*"

***Value :** "Bearer"*\
\&#xNAN;***Type :** string*

{% hint style="info" %}
The "id\_token" and "access\_token" are available 1 hour.&#x20;
{% endhint %}
