Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
API Blueprint for Bookstore
FORMAT: 1A
# Bookstore
Bookstore is a simple API which allows consumers to view all books and create new ones.
## Group Book
Resources related to books in the API.
### Book collection [/books]
This resource allows you to view a list of books and create a new book.
#### View all books [GET]
This actions returns all books in JSON format.
+ Response 200 (application/json)
{
"data": [
{
"id": 1,
"title": "A Collection of Laravel Tutorials",
"author": "Mario Bašić"
},
{
"id": 2,
"title": "12 Steps for a brighter tomorrow",
"author": "Mario Bašić"
}
]
}
#### Create a new book [POST]
You may create a new book using this action. It takes a JSON
object containing a title and an author.
+ title (string) - The title of the book.
+ author (string) - Name of the author.
+ Request (application/json)
{
"title": "The answer to everything",
"author": "Mario Bašić",
}
+ Response 201 (application/json)
{
"id": 3,
"title": "The answer to everything",
"author": "Mario Bašić",
}
### Book [/books/{book_id}]
This resource allows you to view a single book.
+ Parameters
+ book_id (number) - The ID of the book you want to view.
#### View a single book [GET]
This actions returns a book in JSON format.
+ Response 200 (application/json)
{
"id": 3,
"title": "The answer to everything",
"author": "Mario Bašić",
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment