# 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 %}


---

# 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://transiteo.gitbook.io/transiteo/authentification-tokens.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.
