API Reference
OTP Generate (Direct)

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

NomValeurDescription
Content-Typeapplication/jsonFormat du corps de la requête
AuthorizationBasic <base64(credentials)>Authentification de base

Body Parameters

NomTypeRequisDescription
project_keystringOuiClé du projet
e_identifierstringOuiCompte e pour lequel l'OTP est généré
titlestringNonTitre associé
expiration_timeintegerNonTemps 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

NomDescription
otpTimeLeftTemps restant avant expiration de l'OTP
{
  "otpTimeLeft": "string"
}

Erreurs typiques

Code d'erreurPayloadMessage d'erreurDescription
ERROR_CODE_BAD_REQUEST4001Projet invalide.Clé projet incorrecte ou invalide
ERROR_CODE_BAD_REQUEST4002Compte 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.