Skip to content

lonebots/task-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API DOCUMENTATION

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.

API Endpoints

1. Admin login :

  POST /api/admin/login
defaul admin credentials
username : admin
password : admin
Parameter Type Description
username string Required. User name
password string Required. User password

Protected Routes

accesstoken recieved during login need to be passed in Authorisation Header as Bearer Token for authentication.

1. Create User

  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

2. Update User

  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

3. Delete User

  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

4. Get Single User

  GET /api/user/:id
Parameter Type Description
id string Required. passed in Params

5. Get All User

  GET /api/users
Parameter Type Description
id string Required. passed in Params