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

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

Description des champs de la réponse

Champ
Type
Description

words

array

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

Mis à jour

Ce contenu vous a-t-il été utile ?