Skip to content

srikanthreddy919/administrative-api-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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
export DEVISE_SECRET_KEY=generate_secret_key
  • For sign in request
http://localhost:3000/users/sign_in

required params email and password

{
  "user":{
	  "email": "[email protected]",
	  "password": "password"
  }
}
  • 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
  • To Create user
POST http://localhost:3000/api/v1/users
  • Sample user Object for creation
{
	"user": {
		"email": "[email protected]",
		"name": "sample name",
		"mobile_number": "888888822",
		"password": "password",
		"password_confirmation": "password",
		"tags": [1]
	}
}
  • For update user
PUT http://localhost:3000/api/v1/users/:id
  • To disable the user add disabled to user object
disabled: true
  • For list of tags
GET http://localhost:3000/api/v1/tags
  • To create new tag
POST http://localhost:3000/api/v1/tags
  • sample Tag Object for creation
{
	"tag": {"name": "employee"}
}
  • To update tag
PUT http://localhost:3000/api/v1/tags/:id
  • To search users

search with email or name

GET http://localhost:3000/api/v1/users?search=query
  • To sort users
GET http://localhost:3000/api/v1/users?sorty_by=field_name&sort_order=asc
  • To search tags

search with name

GET http://localhost:3000/api/v1/tags?search=query
  • To sort tags
GET http://localhost:3000/api/v1/tags?sort_order=asc

About

Rails 5 API app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published