Library-Management-System API API Reference

Library-Management-System API Information

Version: 0.1.0

Authentication

Books

Everything about Books

LIST

GET /api/books/

List of the Books

page: int
in query

page of query

name: string
in query

name of the book

cbNum: string
in query

name of the book

genr: string
in query

genre of the book

sort: string asc, desc
in query

genre of the book

lte: boolean
in query

on giving cupboard number(cbNum) results are (n>cbNum), if lte is passed results are (n<cbNum)

200 OK

A successful response

CREATE

POST /api/books/

Add a new Book

undefined

Request Example
{
  "id": "ObjectId('5f4399be7c4460234c97a71d')",
  "name": "War and Peace",
  "cupBoardNumber": 7845,
  "genre": "Action"
}
201 Created

Successful response

406 Not Acceptable

Empty Body

READ

GET /api/books/{id}

Read Book

id: string
in path

(no description)

200 OK

Successful response

404 Not Found

Book Not Found

DELETE

DELETE /api/books/{id}

Delete Books

id: string
in path

(no description)

204 No Content

Successful response

400 Bad Request

Empty Body

UPDATE

PUT /api/books/{id}/edit

Update Books

id: string
in path

(no description)

202 Accepted

Book Updated

400 Bad Request

Empty Body

default

GET /

Get the available routes.

200 OK

A successful response

Response Content-Types: application/json

Schema Definitions

Book: object

id: string (ObjectId)
name: string (string)
cupBoardNumber: integer (int)
genre: string (string)
Example
{
  "id": "ObjectId('5f4399be7c4460234c97a71d')",
  "name": "War and Peace",
  "cupBoardNumber": 7845,
  "genre": "Action"
}

User: object

id: string (ObjectId)
email: email (email)
password: string
firstname: string
lastname: string
fullname: string
Example
{
  "id": "ObjectId('5f4399be7c4460234c97a71d')",
  "email": "example@gmail.com",
  "password": "qwQ12$#w",
  "firstname": "Ram",
  "lastname": "John",
  "fullname": "Ram John"
}