OTP Generate (Direct)
Génère un code OTP pour un identifiant donné.
Méthode : POST
URL : /api/v1/esphere/direct/otp-generate
Authentification : Basic Auth requise
Requête
Headers
| Nom | Valeur | Description |
|---|---|---|
Content-Type | application/json | Format du corps de la requête |
Authorization | Basic <base64(credentials)> | Authentification de base |
Body Parameters
| Nom | Type | Requis | Description |
|---|---|---|---|
project_key | string | Oui | Clé du projet |
e_identifier | string | Oui | Compte e pour lequel l'OTP est généré |
title | string | Non | Titre associé |
expiration_time | integer | Non | Temps d'expiration en minutes (ex: 2) |
Exemple de requête
Exemple HTTP
POST /api/v1/esphere/direct/otp-generate HTTP/1.1
Host: <host>
Content-Type: application/json
Authorization: Basic <base64(username:password)>
{
"project_key": "string",
"e_identifier": "string",
"title": "string",
"expiration_time": 2
}Exemple curl
curl -X POST \
'<host>/api/v1/esphere/direct/otp-generate' \
-H 'Content-Type: application/json' \
-u 'username:password' \
-d '{
"project_key": "string",
"e_identifier": "string",
"title": "string",
"expiration_time": 2
}'{
"project_key": "string",
"e_identifier": "string",
"title": "string",
"expiration_time": 2
}Réponses
200 Success
Le code OTP a été généré avec succès.
Content-Type: application/json
| Nom | Description |
|---|---|
otpTimeLeft | Temps restant avant expiration de l'OTP |
{
"otpTimeLeft": "string"
}Erreurs typiques
| Code d'erreur | Payload | Message d'erreur | Description |
|---|---|---|---|
ERROR_CODE_BAD_REQUEST | 4001 | Projet invalide. | Clé projet incorrecte ou invalide |
ERROR_CODE_BAD_REQUEST | 4002 | Compte e invalide. | Compte e@ incorrecte ou invalide |
Erreurs standards
400 Input Error
Erreur dans les données d'entrée. Vérifiez le corps de la requête.
401 Unauthorized
Non autorisé.
403 Access Denied
Accès refusé. Des privilèges supplémentaires sont nécessaires.
404 Not Found
La ressource demandée n'existe pas.
429 Rate Limited
Trop de requêtes.
500 Unexpected Error
Erreur inattendue du serveur.