Skip to main content
POST
/
books
/
add
add
curl --request POST \
  --url http://localhost:8000/v1/books/add \
  --header 'Content-Type: application/json' \
  --data @- <<EOF
{
  "ISBN10": "2212122789",
  "author": "Marilynne Robinson",
  "genre": "670e14f586ced1463b2b60bc",
  "price": 122,
  "publishedMonth": 1,
  "publishedYear": 2003,
  "publisher": "Abebe's publishing",
  "title": "Gilead"
}
EOF
{
  "data": {
    "book": {
      "ISBN10": "2212122789",
      "ISBN13": "9782212122787",
      "__v": 0,
      "_id": "670e2ce78296c4aa4d1374ad",
      "author": "Marilynne Robinson",
      "createdAt": "2024-10-15T08:50:47.768Z",
      "genre": "670e14f586ced1463b2b60bc",
      "isPrivatePublisher": false,
      "price": 12200,
      "publishedDate": "2002-12-31T21:00:00.000Z",
      "publisher": "Abebe's publishing",
      "rating": 0,
      "title": "Gilead",
      "updatedAt": "2024-10-15T08:50:47.768Z"
    }
  },
  "error": null
}

Body

application/json
ISBN10
string
Example:

"2212122789"

author
string
Example:

"Marilynne Robinson"

genre
string
Example:

"670e14f586ced1463b2b60bc"

price
number
Example:

122

publishedMonth
number
Example:

1

publishedYear
number
Example:

2003

publisher
string
Example:

"Abebe's publishing"

title
string
Example:

"Gilead"

Response

add - success

data
object
error
unknown