Authentification
Pour authentifier un utilisateur et obtenir un accessToken qui sera valable pour une durée de 24H.
Requête
Endpoint
POST https://selene.api.centarauto.fr/auth
Paramètres
| Paramètre | Type | Description |
|---|---|---|
| username | string | Nom d'utilisateur |
| key | string | Clé d'accés |
Réponse
Paramètres
| Paramètre | Type | Description |
|---|---|---|
| accessToken | string | Token d'accès à inclure dans toutes les requêtes |
Exemple
Requête en JS
const axios = require('axios').default;
const url = 'https://selene.api.centarauto.fr/auth';
// Remplacer USER_NAME & ACCESS_KEY par vos identifiants
const data = {
username: USER_NAME,
key: ACCESS_KEY
};
// Send the POST request
axios({
method: 'post',
url,
data
})
.then((response) => response.data)
.then((data) => {
// Utiliser la réponse
console.log("Data : ", data);
})
.catch((error) => {
// Gérer l'erreur
console.log("Error : ", error.response);
});
Réponse
{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhZG1pbiIsImV4cCI6MTU5MTE5MTY4OCwic3ViIjoiNWVjNDVhZjlhYTc4Mzk2NTFjY2QzMjAyIiwiaWF0IjoxNTkxMTA1Mjg4fQ.yOuCx5NNKE39KlP1fvdkVY8dxhFoy7YZeK7BV3LUcWc"
}
