83 lines
1.4 KiB
Markdown
83 lines
1.4 KiB
Markdown
|
|
|
||
|
|
**BASE** : https://mkdlabs.com
|
||
|
|
**Credential**
|
||
|
|
- role : admin,
|
||
|
|
- email: adminlibrary3@manaknight.com.
|
||
|
|
- password: a123456
|
||
|
|
|
||
|
|
|
||
|
|
## APIS
|
||
|
|
|
||
|
|
***Authenticate***
|
||
|
|
|
||
|
|
POST /v2/api/lambda/login
|
||
|
|
|
||
|
|
*Authenticates a user and returns the token which expires in an hour.*
|
||
|
|
Required/Mandatory Fields
|
||
|
|
email: 'required|string'
|
||
|
|
password: 'required|string'
|
||
|
|
role: 'required'
|
||
|
|
|
||
|
|
|
||
|
|
***List Books***
|
||
|
|
|
||
|
|
GET /v2/api/custom/qa/books
|
||
|
|
|
||
|
|
*List all books*
|
||
|
|
|
||
|
|
***Get A Book***
|
||
|
|
|
||
|
|
GET /v2/api/custom/qa/books/:id
|
||
|
|
*Get a book where id is `:id`*
|
||
|
|
|
||
|
|
***Create Book***
|
||
|
|
|
||
|
|
POST /v2/api/custom/qa/books
|
||
|
|
|
||
|
|
*Creates a new book,*
|
||
|
|
|
||
|
|
- [x] Bearer authentication required, role - admin
|
||
|
|
|
||
|
|
Required/Mandatory Body
|
||
|
|
name: 'required|string',
|
||
|
|
publisher: 'required|string',
|
||
|
|
cost_price: 'required'
|
||
|
|
|
||
|
|
***Update Book***
|
||
|
|
|
||
|
|
PUT /v2/api/custom/qa/books/:id
|
||
|
|
|
||
|
|
*Updates book where id is `:id`,*
|
||
|
|
|
||
|
|
- [x] Bearer authentication required, role - admin
|
||
|
|
|
||
|
|
Body
|
||
|
|
name: 'sometimes|string',
|
||
|
|
publisher: 'sometimes|string',
|
||
|
|
cost_price: 'sometimes',
|
||
|
|
selling_price: 'sometimes',
|
||
|
|
author_id: 'sometimes',
|
||
|
|
title_id: 'sometimes'
|
||
|
|
|
||
|
|
***Delete Book***
|
||
|
|
|
||
|
|
|
||
|
|
DELETE /v2/api/custom/qa/books/:id
|
||
|
|
|
||
|
|
*Deletes book where id is `:id`,*
|
||
|
|
|
||
|
|
- [x] Bearer authentication required, role - admin
|
||
|
|
|
||
|
|
|
||
|
|
***Create Author***
|
||
|
|
|
||
|
|
POST /v2/api/custom/qa/authors
|
||
|
|
|
||
|
|
*Creates a new author,*
|
||
|
|
|
||
|
|
|
||
|
|
- [x] Bearer authentication required, role - admin
|
||
|
|
|
||
|
|
Required/Mandatory body
|
||
|
|
name: 'required|string',
|
||
|
|
age: 'required|number',
|