-
Notifications
You must be signed in to change notification settings - Fork 0
/
endpoints.json
149 lines (145 loc) · 4.01 KB
/
endpoints.json
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
{
"GET /api": {
"description": "serves up a json representation of all the available endpoints of the api"
},
"GET /api/categories": {
"description": "serves an array of all categories",
"queries": [],
"exampleResponse": {
"categories": [
{
"description": "Players attempt to uncover each other's hidden role",
"slug": "Social deduction"
}
]
}
},
"GET /api/reviews": {
"description": "serves an array of all reviews",
"queries": ["category", "sort_by", "order"],
"exampleResponse": {
"reviews": [
{
"title": "One Night Ultimate Werewolf",
"designer": "Akihisa Okui",
"owner": "happyamy2016",
"review_img_url": "https://images.pexels.com/photos/5350049/pexels-photo-5350049.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260",
"category": "hidden-roles",
"created_at": 1610964101251,
"votes": 5
}
]
}
},
"GET /api/reviews/:review_id": {
"description": "serves review object with specified review id",
"queries": [],
"exampleResponse": {
"review":
{
"review_id": 2,
"title": "Jenga",
"designer": "Leslie Scott",
"owner": "philippaclaire9",
"review_img_url":
"https://www.golenbock.com/wp-content/uploads/2015/01/placeholder-user.png",
"review_body": "Fiddly fun for all the family",
"category": "dexterity",
"created_at": 1610964101251,
"votes": 5,
"comment_count": 3
}
}
},
"GET /api/reviews/:review_id/comments": {
"description": "serves an array of comments for a given review id",
"queries": [],
"exampleResponse": {
"comments": [
{
"comment_id": 1,
"votes": 16,
"created_at": 1511354613389,
"author":"bainesface",
"body":"I loved this game too!'",
"review_id":2
},
{
"comment_id": 4,
"votes": 16,
"created_at": 1511354163389,
"author":"bainesface",
"body":"EPIC board game!",
"review_id":2
},
{
"comment_id": 5,
"votes": 5,
"created_at": 1610965445410,
"author":"mallionaire",
"body":"Now this is a story all about how, board games turned my life upside down",
"review_id":2
}
]
}
},
"GET /api/users": {
"description": "serves an array of all reviews",
"queries": [],
"exampleResponse": {
"users": [
{
"username": "mallonaire",
"name": "haz",
"avatar_url":
"https://www.healthytherapies.com/wp-content/uploads/2016/06/Lime3.jpg"
}
]
}
},
"POST /api/reviews/:review_id/comments": {
"description": "post a new comment to the given review id",
"queries": [],
"exampleInput":{
"username":"mallionaire",
"body":"some comment"
},
"exampleResponse": {
"comment":
{
"comment_id": 6,
"votes": 0,
"created_at": 1511354613389,
"author":"bainesface",
"body":"I loved this game too!'",
"review_id": 2
}
}
},
"PATCH /api/reviews/:review_id": {
"description": "patches votes to increase by the value given",
"queries": [],
"exampleInput":{
"inc_votes":1
},
"exampleResponse": {
"review":
{
"review_id": 2,
"title": "Jenga",
"designer": "Leslie Scott",
"owner": "philippaclaire9",
"review_img_url":
"https://www.golenbock.com/wp-content/uploads/2015/01/placeholder-user.png",
"review_body": "Fiddly fun for all the family",
"category": "dexterity",
"created_at": 1610964101251,
"votes": 6,
"comment_count": 3
}
}
},
"DELETE /api/comments/:comment_id": {
"description": "deletes comment byt the comment id"
}
}