Aller au contenu
Français

Obtenir un jeton utilisateur

POST/v1/auth/token

Émet un jeton d'accès pendant une heure en fonction de l'identifiant et du mot de passe. Spécifiez mode=account pour accéder à toutes les boîtes aux lettres du compte ou mode=mailbox pour accéder à une adresse. Passez access_token dans l’en-tête Authorization: Bearer <access_token>.

Zones d’autorisation et d’accès · Erreurs et répétitions

Demande

Fenêtre de terminal
curl -X POST 'https://adapt-mail.com/v1/auth/token' \
-H 'Content-Type: application/json' \
--data '{"login":"user-123","password":"<password>"}'

Corps de la demande · application/json

object

loginNécessairement

string

passwordNécessairement

string

minLength: 1

maxLength: 128

mode

string

Valeurs valides: "account" "mailbox"

Défaut: "account"

Les champs inconnus ne sont pas acceptés.

Réponses

200 Réponse réussie

application/json

object

access_token

string

token_type

string

"Bearer"

expires_in

integer

3600

mailbox_id
Option 1

integer

Option 2

null

401 Connexion requise

application/json

object

detail
Option 1

string

Option 2

object

code

string

message

string

Option 3

array

Éléments du tableau

object

403 Pas d'accès

application/json

object

detail
Option 1

string

Option 2

object

code

string

message

string

Option 3

array

Éléments du tableau

object

404 Ressource introuvable

application/json

object

detail
Option 1

string

Option 2

object

code

string

message

string

Option 3

array

Éléments du tableau

object

409 Conflit d'État

application/json

object

detail
Option 1

string

Option 2

object

code

string

message

string

Option 3

array

Éléments du tableau

object

422 Erreur de validation

application/json

object

detail

array

Éléments du tableau

object

locNécessairement

array

Éléments du tableau
Option 1

string

Option 2

integer

msgNécessairement

string

typeNécessairement

string

429 Trop de demandes

application/json

object

detail
Option 1

string

Option 2

object

code

string

message

string

Option 3

array

Éléments du tableau

object

503 Indisponibilité temporaire

application/json

object

detail
Option 1

string

Option 2

object

code

string

message

string

Option 3

array

Éléments du tableau

object