-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathendpoints.json
More file actions
150 lines (150 loc) · 4.54 KB
/
endpoints.json
File metadata and controls
150 lines (150 loc) · 4.54 KB
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
149
150
{
"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/:review_id": {
"description": "serves a single review object",
"queries": [],
"exampleResponse": {
"reviews": [
{
"review_id": 3,
"title": "Ultimate Werewolf",
"designer": "Akihisa Okui",
"owner": "bainesface",
"review_img_url":
"https://www.golenbock.com/wp-content/uploads/2015/01/placeholder-user.png",
"review_body": "We couldn't find the werewolf!",
"category": "social deduction",
"created_at": "2021-01-18T10:01:41.251Z",
"votes": 5,
"comment_count": 3
}
]
}
},
"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/comments": {
"description": "serves an array of objects containing all the comments relating to that review",
"queries": [],
"exampleResponse": {
"comments": [
{
"comment_id": 6,
"body": "Not sure about dogs, but my cat likes to get involved with board games, the boxes are their particular favourite",
"review_id": 3,
"author": "philippaclaire9",
"votes": 10,
"created_at": "2021-03-27T19:49:48.110Z"
},
{
"comment_id": 3,
"body": "I didn't know dogs could play games",
"review_id": 3,
"author": "philippaclaire9",
"votes": 10,
"created_at": "2021-01-18T10:09:48.110Z"
},
{
"comment_id": 2,
"body": "My dog loved this game too!",
"review_id": 3,
"author": "mallionaire",
"votes": 13,
"created_at": "2021-01-18T10:09:05.410Z"
}
]
}
},
"GET /api/users": {
"description": "serves an object containing an array of all user objects",
"queries": [],
"exampleResponse": {
"users": [
{
"username": "mallionaire",
"name": "haz",
"avatar_url": "https://www.healthytherapies.com/wp-content/uploads/2016/06/Lime3.jpg"
},
{
"username": "philippaclaire9",
"name": "philippa",
"avatar_url": "https://avatars2.githubusercontent.com/u/24604688?s=460&v=4"
},
{
"username": "bainesface",
"name": "sarah",
"avatar_url": "https://avatars2.githubusercontent.com/u/24394918?s=400&v=4"
},
{
"username": "dav3rid",
"name": "dave",
"avatar_url": "https://www.golenbock.com/wp-content/uploads/2015/01/placeholder-user.png"
}
]
}
},
"PATCH /api/reviews/:review_id": {
"description": "serves an object containing the updated review",
"queries": [],
"exampleResponse": {
"updatedReview": {
"review_id": 2,
"title": "Jenga",
"category": "dexterity",
"designer": "Leslie Scott",
"owner": "philippaclaire9",
"review_body": "Fiddly fun for all the family",
"review_img_url": "https://www.golenbock.com/wp-content/uploads/2015/01/placeholder-user.png",
"created_at": "2021-01-18T10:01:41.251Z",
"votes": 8
}
}
},
"POST /api/reviews/:review_id": {
"description": "serves an object containing the new comment",
"queries": [],
"exampleResponse": {
"newComment": {
"comment_id": 7,
"body": "Formed a rubble alliance",
"review_id": 13,
"author": "bainesface",
"votes": 0,
"created_at": "2022-12-19T12:12:41.418Z"
}
}
},
"DELETE /api/reviews/:review_id/comments": {
"description": "deletes comment and returns with no content",
"queries": []
}
}