Skip to content

srikanthreddy919/users-management

Repository files navigation

README

This README would normally document whatever steps are necessary to get the application up and running.

Things you may want to cover:

  • Ruby version
ruby >= 2.6.3
  • Bundle install
bundle install
  • Create database & Migrate
rake db:create db:migrate db:seed
  • export env variables
  • To generate secret key
bundle exec rake secret
export DEVISE_SECRET_KEY=generated_secret_key
  • For sign in request
POST http://localhost:3000/admins/sign_in

required params username and password

{
  "admin": {
    "username": "[email protected]",
    "password": "password"
  }
}
  • For sign out admin
DELETE http://localhost:3000/admins/sign_out
  • after successfull signin request, copy the token from Authorization header and send along with all the requests

as Bearer your_token

  • For list of users
GET http://localhost:3000/api/v1/users
  • For get a specific user
GET http://localhost:3000/api/v1/users/:id
  • To Create user
POST http://localhost:3000/api/v1/users
  • Sample user Object for creation
{
  "user": {
    "email": "[email protected]",
    "name": "sample name",
    "phone": "888888822",
    "status": "active"
  }
}
  • For update user
PUT/PATCH http://localhost:3000/api/v1/users/:id
  • Payload
{
  "user": {
    "email": "[email protected]",
    "name": "sample name",
    "phone": "888888844",
    "status": "active"
  }
}
  • For delete user
DELETE http://localhost:3000/api/v1/users/:id

Releases

No releases published

Packages

No packages published