Users

API endpoint for manage users.

Data management

/api/users

GET /storekeeper/api/users

List users (for administrators only)

Status Codes:

Example request:

GET /storekeeper/api/users 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"
  },
  {
    "admin": false,
    "disabled": false,
    "email": "foo@bar.com",
    "id": 2,
    "username": "foo"
  }
]
POST /storekeeper/api/users

Create user (for administrators only)

Status Codes:

Example request:

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

{
  "email": "foo@bar.com",
  "password": "bar",
  "username": "foo"
}

Example response:

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

{
  "admin": false,
  "disabled": false,
  "email": "foo@bar.com",
  "id": 2,
  "username": "foo"
}

/api/users/<id>

GET /storekeeper/api/users/(int: id)

Get user

Parameters:
  • id – ID of selected user for get
Status Codes:

Example request:

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

Example response:

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

{
  "admin": false,
  "disabled": false,
  "email": "foo@bar.com",
  "id": 2,
  "username": "foo"
}
PUT /storekeeper/api/users/(int: id)

Update user

Parameters:
  • id – ID of selected user for put
Status Codes:

Example request:

PUT /storekeeper/api/users/2 HTTP/1.1
Host: localhost:8000
Content-Type: application/json

{
  "email": "foo@bar.com",
  "password": "bar",
  "username": "new_foo"
}

Example response:

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

{
  "admin": false,
  "disabled": false,
  "email": "foo@bar.com",
  "id": 2,
  "username": "new_foo"
}
DELETE /storekeeper/api/users/(int: id)

Delete user (for administrators only)

Parameters:
  • id – ID of selected user for delete
Status Codes:

Example request:

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

Example response:

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

null

Config management

/api/users/<id>/config

GET /storekeeper/api/users/(int: id)/config

List user items.

Parameters:
  • id – ID of user
Status Codes:

Example request:

GET /storekeeper/api/users/2/config HTTP/1.1
Host: localhost:8000
Content-Type: application/json

Example response:

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

[
  {
    "name": "lang",
    "value": "hu"
  },
  {
    "name": "fruits",
    "value": "[\"apple\", \"orange\", \"banana\"]"
  }
]
POST /storekeeper/api/users/(int: id)/config

Create user item

Parameters:
  • id – ID of user
Status Codes:

Example request:

POST /storekeeper/api/users/2/config HTTP/1.1
Host: localhost:8000
Content-Type: application/json

{
  "name": "lang",
  "value": "hu"
}

Example response:

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

{
  "name": "lang",
  "value": "hu"
}

/api/users/<id>/config/<id>

GET /storekeeper/api/users/(int: id)/config/(string: name)

Get user item

Parameters:
  • id – ID of user
  • name – Name of selected user config value for get
Status Codes:

Example request:

GET /storekeeper/api/users/2/config/lang HTTP/1.1
Host: localhost:8000
Content-Type: application/json

Example response:

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

{
  "name": "lang",
  "value": "hu"
}
PUT /storekeeper/api/users/(int: id)/config/(string: name)

Update user item

Parameters:
  • id – ID of user
  • name – Name of selected user config value for put
Status Codes:

Example request:

PUT /storekeeper/api/users/2/config/lang HTTP/1.1
Host: localhost:8000
Content-Type: application/json

{
  "name": "lang",
  "value": "hu"
}

Example response:

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

{
  "name": "lang",
  "value": "hu"
}
DELETE /storekeeper/api/users/(int: id)/config/(string: name)

Delete user item

Parameters:
  • id – ID of user
  • name – Name of selected user config value for delete
Status Codes:

Example request:

DELETE /storekeeper/api/users/2/config/lang HTTP/1.1
Host: localhost:8000
Content-Type: application/json

Example response:

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

null