user controller - SWEZenith/Living-History-API GitHub Wiki
Create User
Request:
POST /api/v1/users/ HTTP/1.1
Accept: application/json
Content-Type: application/json
{
"username": "yasemin",
"password": "password1234*.!",
"email": "[email protected]",
"accountStatus": "ACTIVE",
"accountType": "STANDARD"
}
Restrictions:
- username is unique
- password will be stored in a secured way
- e-mail is unique and valid
- accountStatus is Enum: CREATED, ACTIVE, LOCKED, DEACTIVATED
- accountType is Enum: STANDARD, ADMIN
- unique id will be created when saving - UUID is recommended
Response:
HTTP/1.1 201 CREATED
{
"id": "4c088c96-bcb0-11e7-abc4-cec278b6b50a",
"username": "ayse",
"password": "password1234*.!",
"email": "[email protected]",
"accountStatus": "CREATED",
"accountType": "STANDARD"
}
Retrieve User by username
Request:
GET /api/v1/users/{username}
Response:
{
"username": "yasemin",
"password": "password1234*.!",
"email": "[email protected]",
"accountStatus": "ACTIVE",
"accountType": "STANDARD"
}