-
Notifications
You must be signed in to change notification settings - Fork 0
/
apiary.apib
95 lines (94 loc) · 4.2 KB
/
apiary.apib
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
FORMAT: 1A
HOST: http://ibdb.me/api
# IBDB API
IBDB API is an API that allows users to get books and authors information.
## Book Attributes:
* `id(integer)`: The ID of the book, used to identify in the database.
* `isbn(string)`: The International Standard Book Number of the book. This number is used to identify unique books such as the edition number and variation of the book.
* `title(string)`: The title of the book.
* `summary(text)`: The summary of the book. Most books have a summary on the back cover.
* `best_seller_date(date)`: The most recent week the book has been on the New York Times Bets Sellers List.
* `best_seller_list(string)`: The specific list the book has been on.
* `book_image(string)`: An image of the front cover of the book.
* `amazon_link(string)`: A link to the book on Amazon.
* `author_id(integer)`: A foreign key ID to author that links the book and author of the book.
* `publisher(string)`: The publisher who published the book.
* `author(Author)`: The list of authors that has contributed to writing the book.
* `description(String)`: The description of the book from amazon.
## Author Attributes:
* `id(integer)`: The ID of the author, used to identify in the database.
* `first_name(string)`: The first name of the author.
* `last_name(string)`: The last name of the author.
* `book_count(integer)`: The number of books the author has had on the New York Times Best Sellers List.
* `best_seller_date(date)`: The most recent week the author has been on the New York Times Best Sellers List.
* `Books(Book)`: The list of books the author has had on the New York Times Best Sellers List.
* `link(string)`: A link to the authors Facebook page.
* `bio(String)`: The biography of the author from amazon.
## Books [/books]
### Get a list of all books [GET]
+ Response 200 (application/json)
[
{
"id": 1,
"isbn": "9780425256763",
"title": "FIRE TOUCHED",
"summary": "The shape-shifter Mercy Thompson and her Alpha werewolf mate, Adam, protect a stolen human child.",
"best_seller_date": "2016-03-12",
"best_seller_list": "Combined Print and E-Book Fiction",
"book_image": "http:\/\/du.ec2.nytimes.com.s3.amazonaws.com\/prd\/books\/9780698180918.jpg",
"amazon_link": "http://www.amazon.com",
"author_id": 1,
"publisher": "Ace",
"author": [],
"description": "this is one great book yo."
}
]
## Single Book [/books/{book_id}]
+ Parameters
+ book_id (number) - Unique id of the book requested
### Get a single book [GET]
+ Response 200 (application/json)
{
"id": 1,
"isbn": "9780425256763",
"title": "FIRE TOUCHED",
"summary": "The shape-shifter Mercy Thompson and her Alpha werewolf mate, Adam, protect a stolen human child.",
"best_seller_date": "2016-03-12",
"best_seller_list": "Combined Print and E-Book Fiction",
"book_image": "http:\/\/du.ec2.nytimes.com.s3.amazonaws.com\/prd\/books\/9780698180918.jpg",
"amazon_link": "http://www.amazon.com",
"author_id": 1,
"publisher": "Ace",
"author": [],
"description": "this is one great book yo."
}
## Authors [/authors]
### Get a list of authors [GET]
+ Response 200 (application/json)
[
{
"id": 1,
"first_name": "Anthony",
"last_name": "Doerr",
"book_count": 1,
"best_seller_date": "2016-03-12",
"Books": [],
"link": "www.facebook.com",
"bio": "he had a long and fun life"
}
]
## Single Author [/authors/{author_id}]
+ Parameters
+ author_id (number) - Unique id of the author requested
### Get a single author [GET]
+ Response 200 (application/json)
{
"id": 1,
"first_name": "Anthony",
"last_name": "Doerr",
"book_count": 1,
"best_seller_date": "2016-03-12",
"Books": [],
"link": "www.facebook.com",
"bio": "he had a long and fun life"
}