https://github.com/jakeoeding/book-api
REST API for storing and retrieving book data
https://github.com/jakeoeding/book-api
api flask flask-restful
Last synced: 2 months ago
JSON representation
REST API for storing and retrieving book data
- Host: GitHub
- URL: https://github.com/jakeoeding/book-api
- Owner: jakeoeding
- Created: 2020-06-05T21:55:17.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-10T22:36:11.000Z (about 6 years ago)
- Last Synced: 2025-02-17T09:45:02.839Z (over 1 year ago)
- Topics: api, flask, flask-restful
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Book Api
Basic RESTful api with book data
## Usage
### List all books
**Definition**
`GET /books`
**Response**
- `200 OK` on success
```json
[
{
"id:": "1",
"title": "Moby-Dick",
"author": "Herman Melville",
"isbn": "9781503280786",
"category": "fiction"
},
{
"id:": "2",
"title": "American Kingpin",
"author": "Nick Bilton",
"isbn": "9781591848141",
"category": "nonfiction"
}
]
```
### Register a new book
**Definition**
`POST /books`
**Arguments**
- `"title":string` book title
- `"author":string` author full name
- `"isbn":string` the 13 digit ISBN related to the title
- `"category:string"` the type of book: either fiction or nonfiction
**Response**
- `201 CREATED` upon success
```json
{
"id:": "1",
"title": "Moby-Dick",
"author": "Herman Melville",
"isbn": "9781503280786",
"category": "fiction"
}
```
### Get a single book
**Definition**
`GET /book/`
**Response**
- `200 OK` on success
- `404 NOT FOUND` if book does not exist
```json
{
"id:": "1",
"title": "Moby-Dick",
"author": "Herman Melville",
"isbn": "9781503280786",
"category": "fiction"
}
```
### Update a book
**Definition**
`PUT /book/`
**Arguments**
- `"title":string` book title
- `"author":string` author full name
- `"isbn":string` the 13 digit ISBN related to the title
- `"category:string"` the type of book: either fiction or nonfiction
**Response**
- `200 OK` upon success
- `404 NOT FOUND` if book does not exist
```json
{
"id:": "1",
"title": "Moby-Dick",
"author": "Herman Melville",
"isbn": "9781503280786",
"category": "fiction"
}
```
### Delete a book
**Definition**
`DELETE /book/`
**Response**
- `204 NO CONTENT` upon success
- `404 NOT FOUND` if book does not exist