Public
Documentation Settings

Sample_REST

POSTAdd Category

127.0.0.1:3000/category

The Categories are for books(Like Fiction,Drama etc)

API Call to add a category

HEADERS
Content-Type

application/json

Bodyraw
{
  "Title": "hjjh"
}
Example Request
curl
curl --location '127.0.0.1:3000/Category' \
--header 'Content-Type: application/json' \
--data '{
  "Title": "Fantasy"
}'
200 OK
Example Response
json
{
  "Title": "Fantasy"
}
Access-Control-Allow-Origin

*

Connection

keep-alive

Content-Length

19

Content-Type

application/json; charset=utf-8

Date

Thu, 22 Jun 2017 12:38:10 GMT

ETag

W/"13-6DyOrlOMnZpRqXa/Ji6becnBMTk"

X-Powered-By

Express

GETGet Category Books by Category Name

127.0.0.1:3000/books/?category=Indian
PARAMS
category

Indian

Example Request
curl
curl --location '127.0.0.1:3000/books/?category=Indian'
200 OK
Example Response
json
[
  {
    "id": 2,
    "title": "ABC",
    "category": "Indian",
    "author": "hh",
    "year": 2001,
    "edition": 2,
    "color": "blue",
    "num_pages": 22,
    "img_link": "www.xyz.com"
  },
  {
    "id": 3,
    "title": "ZBC",
    "category": "Indian",
    "author": "hh",
    "year": 2001,
    "edition": 2,
    "color": "yellow",
    "num_pages": 22,
    "img_link": "www.xyz.com"
  },
  {
    "id": 4,
    "title": "XZX",
    "category": "Indian",
    "author": "hh",
    "year": 2001,
    "edition": 2,
    "color": "yellow",
    "num_pages": 22,
    "img_link": "www.xyz.com"
  },
  {
    "id": 5,
    "title": "kjkj",
    "category": "Indian",
    "author": "hh",
    "year": 2001,
    "edition": 2,
    "color": "yellow",
    "num_pages": 22,
    "img_link": "www.xyz.com"
  },
  {
    "id": 6,
    "title": "kjkj",
    "category": "Indian",
    "author": "hh",
    "year": 2001,
    "edition": 2,
    "color": "yellow",
    "num_pages": 32,
    "img_link": "www.xyz.com"
  },
  {
    "id": 7,
    "title": "kjscdkj",
    "category": "Indian",
    "author": "hh",
    "year": 2001,
    "edition": 2,
    "color": "yellow",
    "num_pages": 35,
    "img_link": "www.xyz.com"
  }
]
Access-Control-Allow-Origin

*

Connection

keep-alive

Content-Length

833

Content-Type

application/json; charset=utf-8

Date

Thu, 22 Jun 2017 13:29:08 GMT

ETag

W/"341-gO/K3kA4PWfMifA/OCuV9VXfWKs"

X-Powered-By

Express

DELETEDelete Category

127.0.0.1:3000/category/xyz

API Call to delete a category

Example Request
curl
curl --location --request DELETE '127.0.0.1:3000/category/xyz'
200 OK
Example Response
json
{
  "msg": "Success"
}
Access-Control-Allow-Origin

*

Connection

keep-alive

Content-Length

17

Content-Type

application/json; charset=utf-8

Date

Thu, 22 Jun 2017 14:11:56 GMT

ETag

W/"11-Qejtnw7VUaWLKrBMnWYy3L+HPi8"

X-Powered-By

Express

PUTUpdate Category

127.0.0.1:3000/category/Fantasy1

API Call to Update a Category

HEADERS
Content-Type

application/json

Bodyraw
{
  "Title": "FantasyOne"
}
Example Request
curl
curl --location --request PUT '127.0.0.1:3000/category/Fantasy1' \
--header 'Content-Type: application/json' \
--data '{
  "Title": "FantasyOne"
}'
200 OK
Example Response
json
{
  "msg": "Success"
}
Access-Control-Allow-Origin

*

Connection

keep-alive

Content-Length

17

Content-Type

application/json; charset=utf-8

Date

Thu, 22 Jun 2017 14:11:13 GMT

ETag

W/"11-Qejtnw7VUaWLKrBMnWYy3L+HPi8"

X-Powered-By

Express