Session

API endpoint for manage the current session.

Session management

/api/session

GET /storekeeper/api/session

Get current session

Status Codes:

Example request:

GET /storekeeper/api/session HTTP/1.1
Host: localhost:8000
Content-Type: application/json

Example response:

HTTP/1.0 200 OK
Content-Type: application/json

{
  "admin": true,
  "disabled": false,
  "email": "admin@test.com",
  "id": 1,
  "username": "admin"
}
POST /storekeeper/api/session

Login user

Status Codes:

Example request:

POST /storekeeper/api/session HTTP/1.1
Host: localhost:8000
Content-Type: application/json

{
  "password": "secret",
  "remember": false,
  "username": "admin"
}

Example response:

HTTP/1.0 201 CREATED
Content-Type: application/json

{
  "admin": true,
  "disabled": false,
  "email": "admin@test.com",
  "id": 1,
  "username": "admin"
}
DELETE /storekeeper/api/session

Logout user

Status Codes:

Example request:

DELETE /storekeeper/api/session HTTP/1.1
Host: localhost:8000
Content-Type: application/json

Example response:

HTTP/1.0 200 OK
Content-Type: application/json

null