Create Book
To create the data in the specified collection with the specified parameters. When a JSON object is saved, the object properties are automatically added to the collection you specified.
Method : POST
URL : /api/book
Body : JSON
{
"author_id": 216,
"title": "New Book Title",
"isbn": "9780441627400",
"language": "English",
"pages": "639",
"published": "1958-01-01",
"link": "New Book Link",
"image": "New Book Image",
"description": "New Book Description",
"genre": [
{
"value": 1,
"label": "a"
},
{
"value": 2,
"label": "b"
}
]
}
title*Required
string
Book title.
author_id
number
Book author ID.
isbn
string
Book ISBN.
language
string
Book language.
pages
string
Book total page.
published
string (date)
Book published date.
link
string
Book goodread link.
image
string
Book image URL
description
string
Book description
genre
array of object
Book genres.
[
{
"value": "ID of Genre"
},
{
"value": "ID of Genre"
}
]
Response : 200 - OK
{
"message": "Success add book"
}
Response : 422 - Unprocessable Content
{
"error": "Title required"
}
Response : 500 - Server Error
Internal Server Error