Obtenir un token
Cette API permet d'obtenir un token d'accès pour un client API.
Génère un nouveau token d'accès pour un client API.
Endpoint : POST /oauth/login
Headers requis :
X-CLIENT-ID: <votre_client_id>
X-SECRET-KEY: <votre_client_secret>
Content-Type: application/json
Requête :
curl -X POST https://clients-api-services.mazone-test.ansut.ci/api/v1.0/oauth/login \
-H "X-CLIENT-ID: abc123..." \
-H "X-SECRET-KEY: xyz789..." \
-H "Content-Type: application/json"
Réponse succès (200) :
{
"error": false,
"data": {
"access_token": "1|abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ",
"expires_in": 3600,
"token_type": "Bearer"
}
}
Réponse erreur - Credentials invalides (401) :
{
"error": true,
"error_code": "authentication_failed",
"message": "Client invalide ou inactif."
}
Réponse erreur - Headers manquants (401) :
{
"error": true,
"error_code": "required_headers",
"message": "Les headers X-CLIENT-ID et X-SECRET-KEY sont requis."
}
Réponse erreur - Rate limit (429) :
{
"error": true,
"error_code": "too_many_attempts",
"message": "Trop de tentatives. Veuillez réessayer dans 45 secondes."
}
Limitations :
- Rate limiting : 5 tentatives par minute par IP
- Token valide pendant 1 heure (3600 secondes)