Aller au contenu principal

Authentification

Obtenez un jeton d'accès pour authentifier vos requêtes à l'API et accéder aux données sécurisées.

Types de données

AuthResponse

AttributTypeDescription
access_tokenStringJeton d'accès aux données
token_typeStringType d'authentification (bearer)
expires_inNumberNombre de secondes avant l'expiration du jeton

Récupération du jeton d'accès

Authentifiez-vous avec vos identifiants pour obtenir un jeton d'accès JWT valide.

Requête

Point de terminaison

POST /auth/login

Paramètres

ParamètreTypeDescription
usernameStringNom d'utilisateur
secretStringMot de passe du compte

Réponse

AttributTypeDescription
dataAuthResponseDétails du jeton d'accès et de son expiration

Exemple

Requête

curl --location 'https://sandbox-data.orishas-finance.com/api/auth/login' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'username=TestUsername' \
--data-urlencode 'secret=TestUserPassword'

Réponse

{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
"token_type": "bearer",
"expires_in": 8640000
}

Utilisation du jeton d'accès

Pour authentifier vos requêtes, incluez le jeton d'accès dans l'en-tête Authorization avec le schéma Bearer.

Exemple

curl --location 'https://sandbox-data.orishas-finance.com/api/v1/endpoint' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c'