Authentication

1. Check Token

Used during development to validate if a token is working correctly.

Endpoints
  • /check-token
Method: GET
Requires Authentication: YES
Comments

In order to be authenticated, the header "Authorization" with the JSON Web Token must be sended.
The header value needs to start with "Bearer " + token.

For example, a correct header would be:

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiO....

Responses
  • Token validated
    Status code: 200
  • Token not provided
    Status code: 400
  • Invalid authentication token
    Status code: 400
  • Authentication token expired
    Status code: 400

2. Login

Endpoints
  • /login
Method: POST
Requires Authentication: NO
Parameters
  • email

    Validations: required|email|max:255

  • password

    Validations: required|min:6|max:255

Comments

Returns a Token that will have to be sended in every authenticated request to the server.
The token needs to be sended in the "Authorization" header, and its value needs to start with "Bearer " + token.

For example, a correct header would be:

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiO....

Responses
  • Success
    Status code: 200
  • Validation errors
    Status code: 400

3. Reset Password

Sends an email with a token to reset the password.

Endpoints
  • /reset-password
Method: POST
Requires Authentication: NO
Parameters
  • email

    Validations: required|email|max:255

Responses
  • Reset password email sended
    Status code: 200
  • Validation errors
    Status code: 400

4. Signup

Endpoints
  • /signup
Method: POST
Requires Authentication: NO
Parameters
  • name

    Validations: required|max:255

  • email

    Validations: required|email|max:255|unique

  • password

    Validations: required|min:6|max:255|confirmed

  • password_confirmation

Responses
  • Success
    Status code: 200
  • Validation errors
    Status code: 400

5. User Show

Endpoints
  • profile/{user_id}
Method: GET
Requires Authentication: NO
Parameters
  • user_id

    Validations: required|integer|exists:users,id

Responses
  • success
    Status code:
  • Validation errors
    Status code: 200