Skip to content

Access Endpoints

dionisggr edited this page Feb 27, 2021 · 1 revision

Login

URL: /api/auth/token
Method: POST
Auth required: Yes

Request Body

{
  "username": "dwight",
  "password": "password",
}
Name Type In Description
username string header Unique username
password string header User password

Success Response

Code: 200 OK
Content example

{
  "authToken": <JSON Web Token>;
}

Refresh Token

URL: /api/auth/token
Method: PUT
Auth required: Yes

  • Bearer <JSON Web Token>

Success Response

Code: 200 OK
Content example

{
  "authToken": <JSON Web Token>;
}

Registration

URL: /api/user
Method: POST
Auth required: No

  • Bearer my-secret-key

Request Body

Requires headers: {'Content-Type': 'application/json'}

{
  "name": "Dwight Schrute"
  "username": "dwight",
  "password": "pass"
}
Name Type In Description
id integer header Primary key
username string header Unique username
name string header First name of user
password string header User password

Success Reponse

Code: 201 Created
Content example

{
  "id": 1,
  "username": "dwight",
  "name": Dwight Schrute
}