Skip to content
I_AM_TINE edited this page Oct 9, 2022 · 5 revisions

Using for Book's module.

this path goes under /book/***

get book by id

get the information of book using id

URL

GET /:id

query params

PARAMS

Parameter Type Description
id string the book's id

success

RESPONSE

Parameter Type Description
id string userId
name string name of the book
description string book's description
authorId string the id of author

EXAMPLE

{ id: "4573782c4e4043c292b493d53adf8cb2" ,
name: "HELLO WORLD",
description: "SOME BOOK",
authorId: "67d75b88-47b0-11ed-b878-0242ac120002"}

fail

400 ( book not found )


add type of books

create the type of book

URL

POST /type

REQUEST BODY

REQUEST BODY

Parameter Type Description
name string name of book's type

EXAMPLE

{
 name: "COMPUTER"
}

success

RESPONSE

Parameter Type Description
type string book's type

EXAMPLE

{
type : "Computer"
}

fail

500 ( Create type failed )


Add new book to database

register book

URL

POST /register

REQUEST BODY

REQUEST BODY

Parameter Type Description
name string name of book
description string book's description
type string[] type of book in array of string
userId string the id of author

EXAMPLE

{ id: "4573782c4e4043c292b493d53adf8cb2" ,
name: "HELLO WORLD",
description: "SOME BOOK",
authorId: "67d75b88-47b0-11ed-b878-0242ac120002"}

success

RESPONSE

Parameter Type Description
id string userId
name string name of the book
description string book's description
authorId string the id of author

EXAMPLE

{ id: "4573782c4e4043c292b493d53adf8cb2" ,
name: "HELLO WORLD",
description: "SOME BOOK",
authorId: "67d75b88-47b0-11ed-b878-0242ac120002"}

fail

400 ( Create user failed )


Clone this wiki locally