Log in and get a token
POST
https://api-v2.test.eldowallet.fr/auth/login
Exchanges a username (username) and password for a JWT access token, returned in token. Then send this token in the Authorization: Bearer <token> header of every request.
Good to know
- Errors: wrong password gives
401 UNAUTHORIZED, unknownusernamegives404 MODEL_NOT_FOUND, a non-administrator account with no wallet gives400 VALIDATION_ERROR. The JWT expires: for a server-to-server integration, use a wallet token created withPOST /wallets/tokensinstead of storing a password.
Request
header parameters
x-langstringLanguage for responsesenum:en,frdefault:"en"
Body
application/json requiredusernamestring requiredpasswordstring required
Responses
- 201
- 400
- 401
- 404
- 500
Schema
application/jsontokenstring requiredThe token for the userexample:1234567890
VALIDATION_ERROR · INVALID_JSON
Schema
application/jsonmessagestring requiredexample:Promo code already existserrorCodestring requiredexample:400:PROMO_CODE_ALREADY_EXISTSpathstring requiredexample:/couponsdatestring <date-time> requireddetailsobjectvalidationErrorsobject[]fieldstringexample:emailmessagestringexample:email must be an email
UNAUTHORIZED
Schema
application/jsonmessagestring requiredexample:Promo code already existserrorCodestring requiredexample:400:PROMO_CODE_ALREADY_EXISTSpathstring requiredexample:/couponsdatestring <date-time> requireddetailsobjectvalidationErrorsobject[]fieldstringexample:emailmessagestringexample:email must be an email
MODEL_NOT_FOUND
Schema
application/jsonmessagestring requiredexample:Promo code already existserrorCodestring requiredexample:400:PROMO_CODE_ALREADY_EXISTSpathstring requiredexample:/couponsdatestring <date-time> requireddetailsobjectvalidationErrorsobject[]fieldstringexample:emailmessagestringexample:email must be an email
UNKNOWN_ERROR
Schema
application/jsonmessagestring requiredexample:Promo code already existserrorCodestring requiredexample:400:PROMO_CODE_ALREADY_EXISTSpathstring requiredexample:/couponsdatestring <date-time> requireddetailsobjectvalidationErrorsobject[]fieldstringexample:emailmessagestringexample:email must be an email