# getWordsOfDay

## Requête

Permet de récupérer les mots du jour. La réponse retourne un array d'objets [word](/objets/word.md).

#### Endpoint

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

#### Body

```json
{
    "size" : 3,
    "toLanguage" : "fr"
}
```

{% 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({
        "size" : 3,
        "toLanguage" : "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                    |
| ---------- | ------- | ----------------------------------- | ------------------------- |
| size       | integer | nombre de mots à retourner          | optionnelle (default : 3) |
| toLanguage | string  | La langue de traduction (ISO 639-1) | optionnelle (default fr)  |

## Réponse

```json
{
    "Dictionary": {
        "version": 1,
        "authorization": "demo",
        "endValidity": "",
        "variety": "shiKomori ●",
        "entries": "3/3",
        "words": [
            {
                "id": 1514,
                "hasDefinition": true,
                "km": "gari",
                "fr": [
                    "véhicule",
                    "voiture"
                ]
            },
            {
                "id": 7386,
                "hasDefinition": false,
                "km": "gunguni",
                "fr": [
                    "refrigerateur",
                    "frigo"
                ]
            },
            {
                "id": 6395,
                "hasDefinition": true,
                "km": "firigo",
                "fr": [
                    "frigo",
                    "réfrigérateur"
                ]
            }
        ]
    },
    ...
}

```

Description des champs de la réponse

| Champ | Type  | Description                                    |
| ----- | ----- | ---------------------------------------------- |
| words | array | La liste d'objet word au format entrée/valeurs |
|       |       |                                                |


---

# 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/getwordsofday.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.
