Skip to main content

Authentication

Overview

All the API request of Legale is required to authenticated.
You can get the authentication token with this request.
You should send the request with header params Authorization, token prefix is Bearer.
Token will be expired in 5 hours.

Example

{
Authorization: `Bearer {{token}}`,
// Other header options
}

API detail

Request

  • URL: /token
  • Method: POST
  • Content-Type: application/json
  • Body
{
"email": "your.email@legale.io",
"password": "********"
}

Response

Success

  • Status code: 200
  • Body:
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciO....",
"code": null,
"message": "",
}

Error

  • Status code: 400
  • Body:
{
"token": "",
"code": "ERROR_WRONG_PASSWORD",
"message": "Invalid password",
}