An API for user management service
$ cd user-management
$ sbt
> jetty:start
The API runs on http://localhost:8080/. You can try it using curl
or using REST Client app. After it runs, it will create user-management.db
file inside the folder.
- Scalatra 2.12.10
- SQLite 3
- Slick 3.2.3
users
table schema consists ofid
,userName
,emailAddress
,password
,createdAt
,updatedAt
,blockedAt
, andversion
.userName
andemailAddress
are unique properties.id
is an integer starts from 1.version
starts from 1 once a new user is created and increments as it gets updated.
- Deletion is a permanent operation.
The prefix for below endpoints is /api/*
. Some of the endpoints require JSON format body for their parameters.
Method | URI | Description | Body |
---|---|---|---|
GET | users/ | To get a list of all users | |
GET | users/:id | To get a specific user data by its id | |
POST | users/signup | To register a new user data into the DB | userName: STRING , emailAddress: STRING , and password: STRING |
POST | users/:id/block | To block a specific user by its id | |
POST | users/:id/unblock | To unblock a specific user by its id | |
POST | users/:id/reset-password | To reset the password of a user by its id | |
PUT | users/:id | To update a specific user data by its id | At least one of emailAddress: STRING and password: STRING |
DELETE | users/:id | To delete a specific user by its id |