simple REST API implementation with following feature
- admin login
- admin can perform following functionality on the user
- create ,update, delete for user
live demo, please do use PostMan for testing the API.
POST /api/admin/login
defaul admin credentials
username : admin
password : admin
Parameter | Type | Description |
---|---|---|
username |
string |
Required. User name |
password |
string |
Required. User password |
accesstoken
recieved during login need to be passed in Authorisation Header
as Bearer Token
for authentication.
POST /api/user
Parameter | Type | Description |
---|---|---|
name |
string |
Required. Use's name |
email |
string |
Required. User's email |
password |
string |
Required. User's password |
image |
string |
Required. User's profile picture |
phone |
Number |
Required. User's phone number |
PATCH /api/user/:id
Parameter | Type | Description |
---|---|---|
name |
string |
Required. Use's name |
email |
string |
Required. User's email |
password |
string |
Required. User's password |
image |
string |
Required. User's profile picture |
phone |
Number |
Required. User's phone number |
id |
string |
Required. passed in Params |
DELETE /api/user/:id
Parameter | Type | Description |
---|---|---|
name |
string |
Required. Use's name |
email |
string |
Required. User's email |
password |
string |
Required. User's password |
image |
string |
Required. User's profile picture |
phone |
Number |
Required. User's phone number |
id |
string |
Required. passed in Params |
GET /api/user/:id
Parameter | Type | Description |
---|---|---|
id |
string |
Required. passed in Params |
GET /api/users
Parameter | Type | Description |
---|---|---|
id |
string |
Required. passed in Params |