-
Notifications
You must be signed in to change notification settings - Fork 1
0002 User Management
Quyen Phan edited this page Sep 19, 2018
·
5 revisions
# | HTTP | REST API | Description |
---|---|---|---|
1 | GET | /api/users | Get all available users |
2 | POST | /api/users | Register a new user |
3 | PUT | /api/users/{username} | Modify information of an user |
4 | DELETE | /api/users/{username} | Deactive an user |
Description | Get all available users |
HTTP Methods | GET |
API Pattern | /api/users |
Request Parameters | N/A |
Sample | http://localhost:8080/api/users |
Headers | N/A |
N/A
{
"total":-1,
"data":[
{
"username":"cimela",
"firstName":"Quyen",
"lastName":"Quyen",
"email":"[email protected]"
}
]
}
Description | Register a new user |
HTTP Methods | POST |
API Pattern | /api/users |
Request Parameters | N/A |
Sample | http://localhost:8080/api/users |
Headers | Content-Type: application/json |
{
"username":"cimela",
"firstName":"Quyen",
"lastName":"Phan",
"email":"[email protected]"
}
{
"messageCode":"user.insert.success",
"params":["5b99070d391b1ca48057f5c2"]
}
Description | Modify information of an user |
HTTP Methods | PUT |
API Pattern | /api/users/{username} |
Request Parameters | username: username of user |
Sample | http://localhost:8080/api/users/cimela |
Headers | Content-Type: application/json |
{
"username":"cimela",
"firstName":"Quyen",
"lastName":"Phan",
"email":"[email protected]"
}
{
"messageCode":"user.update.success",
"params":["5b99070d391b1ca48057f5c2"]
}