Log in - AmFlint/SI-Hybrid-Api GitHub Wiki

Log In to the api

URL

http://212.47.231.5/login

Http Method

POST

Http Status Codes

  • 400: Bad Request
  • 404: User does not exist

Query Parameters

  • username: string - Username for the user trying to login
  • password: string - Password for the user trying to login

Request

  • Request with Valid credentials
curl -H "Content-Type: application/json" -X POST -d '{"username":"admin","password":"root"}' http://localhost:3000/login 
  • Response
{
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1MTYxMzc5MDcsInVzZXJuYW1lIjoiYW1hc3NlbG90IiwidXNlcklkIjoxLCJpYXQiOjE1MTYxMzQzMDd9.789Uwt-IRWxtgRBxLtpnIifz4PQ54HcMqz7T188Wfi4",
    "id": 1,
    "email": "[email protected]",
    "username": "admin",
    "password": "63a9f0ea7bb98050796b649e85481845",
    "createdAt": "2018-01-16T00:00:00.000Z",
    "updatedAt": "2018-01-16T00:00:00.000Z"
}