-
Notifications
You must be signed in to change notification settings - Fork 0
Book
I_AM_TINE edited this page Oct 9, 2022
·
5 revisions
this path goes under /book/***
get the information of book using id
GET /:id
PARAMS
| Parameter | Type | Description |
|---|---|---|
| id | string | the book's id |
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"}
400 ( book not found )
create the type of book
POST /type
REQUEST BODY
| Parameter | Type | Description |
|---|---|---|
| name | string | name of book's type |
EXAMPLE
{
name: "COMPUTER"
}
RESPONSE
| Parameter | Type | Description |
|---|---|---|
| type | string | book's type |
EXAMPLE
{
type : "Computer"
}
500 ( Create type failed )
register book
POST /register
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"}
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"}
400 ( Create user failed )