# translate

## Requête

Permet de traduire une entrée. La réponse retourne un array d'objets [word](/objets/word.md).

#### Endpoint

```
[Domain]/academy/api/v1/Dictionary/translate
```

#### Body

```json
{
    "entry" : "uleza",
    "languages" : "fr"
}
```

#### Exemple

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

```javascript
const endpoint = "[endpoint]";
const apiKey = "[myAPIKey]";

// Use the username and password to obtain data based on user rights
const username = "[username]"; // optionnel
const password = "[password]"; // optionnel

fetch(endpoint, {
    method: "POST",
    headers: {
        "Authorization": apiKey,
        "Content-Type": "application/json",
        "username ": username,
        "password ": password 
    },
    body: JSON.stringify({
        "entry" : "uleza",
        "languages" : "fr"
    })
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Erreur :", error));

```

{% endtab %}

{% tab title="Second Tab" %}

{% endtab %}
{% endtabs %}

Description des champs de la requête

| Champ     | Type   | Description                                 | Valeur  |
| --------- | ------ | ------------------------------------------- | ------- |
| entry     | string | L'entrée à traduire                         | requise |
| languages | string | La langue de traduction au format ISO 639-2 | requise |
|           |        |                                             |         |

## Réponse

```json
{
    "Dictionary": {
        "version": 7,
        "authorization": "all",
        "endValidity": "",
        "variety": "shiKomori",
        "entries": "1/1",
        "word": {
            "leza (u-)": [
                "rendre ivre",
                "anesthésier"
            ],
            "isShimaore": false,
            "isShimwali": false,
            "isShindzuani": false,
            "isShingazidja": true,
            "dialectSymbols": "◼"
        }
    }
    ...
}
```

{% hint style="warning" %}
Avec une **authorization** de démo, cette requête ne renvoie qu'un nombre limité de mots. Le nombre de mots du dictionnaire est inscrits dans le champ **entries.** Vous pouvez vous servir des champs **authorization** et **entries** pour en informer l'utilisateur.
{% endhint %}

Description des champs de la réponse

| Champ | Type   | Description |
| ----- | ------ | ----------- |
| word  | object | Objet word  |
|       |        |             |


---

# 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://connector-api.orelc.ac/fonctionnalites/getall-2.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.
