getRecentWords

Requête

Permet de récupérer les mots récents. La réponse retourne un array d'objets word.

Endpoint

[Domain]/academy/api/v1/Dictionary/getRecentWords

Body

{
    "size" : 3,
    "toLanguage" : "fr"
}
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));

Description des champs de la requête

ChampTypeDescriptionValeur

size

integer

nombre de mots à retourner

optionnelle (default : 3)

toLanguage

string

La langue de traduction (ISO 639-1)

optionnelle (default fr)

Réponse

{
    "Dictionary": {
        "version": 1,
        "authorization": "demo",
        "endValidity": "",
        "variety": "shiKomori ●",
        "entries": "3/3",
        "words": [
            {
                "id": 8013,
                "hasDefinition": false,
                "km": "mongozi",
                "fr": [
                    "guide",
                    "meneur"
                ]
            },
            {
                "id": 8011,
                "hasDefinition": false,
                "km": "upotro",
                "fr": [
                    "gaucherie",
                    "maladresse"
                ]
            },
            {
                "id": 8010,
                "hasDefinition": false,
                "km": "Mngu",
                "fr": [
                    "Dieu"
                ]
            }
        ]
    },
    ...
}

Description des champs de la réponse

ChampTypeDescription

words

array

La liste d'objet word au format entrée/valeurs

Dernière mise à jour