checkUser
Requête
Permet de vérifier les identifiants utilisateurs.
Endpoint
[Domain]/academy/api/v1/Dictionary/checkUser
Exemple
const endpoint = "[endpoint]";
const apiKey = "[myAPIKey]";
const username = "[username]";
const password = "[password]";
fetch(endpoint, {
method: "POST",
headers: {
"Authorization": apiKey,
"username ": username,
"password ": password
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Erreur :", error));
$endpoint = "[endpoint]";
$apiKey = "[myAPIKey]";
$username = "[username]";
$password = "[password]";
// Prepare data for POST request
$data = [
"username" => $username,
"password" => $password
];
# Prepare request headers
$options = [
"http" => [
"header" => "Authorization: $apiKey\r\n" .
"Content-type: application/x-www-form-urlencoded\r\n",
"method" => "POST",
"content" => http_build_query($data)
]
];
// Send POST request and get response
$context = stream_context_create($options);
$response = file_get_contents($endpoint, false, $context);
if ($response === FALSE) {
echo "Erreur : Impossible de récupérer la réponse.";
} else {
echo $response;
}
import requests
endpoint = "[endpoint]"
api_key = "[myAPIKey]"
username = "[username]"
password = "[password]"
# Prepare data for POST request
data = {
"username": username,
"password": password
}
# Prepare request headers
headers = {
"Authorization": api_key
}
# Send POST request and get response
response = requests.post(endpoint, headers=headers, data=data)
if response.status_code == 200:
print(response.json())
else:
print("Erreur :", response.text)
Réponse
{
"success": true,
"message": "Identifiants valides"
}
Description des champs
Dernière mise à jour