-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathendpoints.json
168 lines (168 loc) · 4.86 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
{
"GET /api": {
"description": "serves up a json representation of all the available endpoints of the api"
},
"GET /api/topics": {
"description": "serves an array of all topics",
"queries": [],
"exampleResponse": {
"topics": [{ "slug": "football", "description": "Footie!" }]
}
},
"GET /api/articles": {
"description": "serves an array of all articles",
"queries": ["topic", "sort_by", "order"],
"exampleResponse": {
"articles": [
{
"article_id": 7,
"author": "weegembump",
"title": "Seafood substitutions are increasing",
"topic": "cooking",
"created_at": "2018-05-30T15:59:13.341Z",
"votes": 0,
"article_img_url": "https://images.example.com/123.jpeg",
"comment_count": 6
}
]
}
},
"GET /api/articles/:article_id": {
"description": "responds with the article with specified id (if it exists)",
"queries": [],
"exampleResponse": {
"article": [
{
"article_id": 3,
"title": "Eight pug gifs that remind me of mitch",
"topic": "mitch",
"author": "icellusedkars",
"body": "some gifs",
"created_at": "2020-11-03T09:12:00.000Z",
"votes": 0,
"article_img_url": "https://images.pexels.com/photos/158651/news-newsletter-newspaper-information-158651.jpeg?w=700&h=700",
"comment_count": 2
}
]
}
},
"PATCH /api/articles/:article_id": {
"description": "updates (increments/decrements) the number of votes on the specified article by the given number and responds with the updated article",
"queries": [],
"requestBody": {
"requiredFields": ["inc_votes"],
"optionalFields": [],
"exampleRequestBody": {
"inc_votes": 100
}
},
"exampleResponse": {
"article": [
{
"article_id": 3,
"title": "Eight pug gifs that remind me of mitch",
"topic": "mitch",
"author": "icellusedkars",
"body": "some gifs",
"created_at": "2020-11-03T09:12:00.000Z",
"votes": 100,
"article_img_url": "https://images.pexels.com/photos/158651/news-newsletter-newspaper-information-158651.jpeg?w=700&h=700"
}
]
}
},
"GET /api/articles/:article_id/comments": {
"description": "responds with an array of the comments on the specified article (if it exists)",
"queries": [],
"exampleResponse": {
"comments": [
{
"comment_id": 7,
"body": "Lobster pot",
"article_id": 1,
"author": "icellusedkars",
"votes": 0,
"created_at": "2020-05-15T21:19:00.000Z"
}
]
}
},
"POST /api/articles/:article_id/comments": {
"description": "posts a new comment at the specified article (if it exists) and responds with the posted comment",
"queries": [],
"requestBody": {
"requiredFields": ["username", "body"],
"optionalFields": [],
"exampleRequestBody": {
"username": "icellusedkars",
"body": "Lobster pot"
}
},
"exampleResponse": {
"comment": [
{
"comment_id": 8,
"body": "Lobster pot",
"article_id": 1,
"author": "icellusedkars",
"votes": 0,
"created_at": "2020-05-15T21:19:00.000Z"
}
]
}
},
"PATCH /api/comments/:comment_id": {
"description": "updates (increments/decrements) the number of votes on the specified comment by the given number and responds with the updated comment",
"queries": [],
"requestBody": {
"requiredFields": ["inc_votes"],
"optionalFields": [],
"exampleRequestBody": {
"inc_votes": 100
}
},
"exampleResponse": {
"comment": [
{
"comment_id": 8,
"body": "Lobster pot",
"article_id": 1,
"author": "icellusedkars",
"votes": 100,
"created_at": "2020-05-15T21:19:00.000Z"
}
]
}
},
"DELETE /api/comments/:comment_id": {
"description": "deletes the specified comment (if it exists) and sends no body back",
"queries": [],
"exampleResponse": {}
},
"GET /api/users": {
"description": "serves an array of all users",
"queries": [],
"exampleResponse": {
"users": [
{
"username": "icellusedkars",
"name": "sam",
"avatar_url": "https://avatars2.githubusercontent.com/u/24604688?s=460&v=4"
}
]
}
},
"GET /api/users/:username": {
"description": "responds with the user with the username given (if it exists)",
"queries": [],
"exampleResponse": {
"user": [
{
"username": "icellusedkars",
"name": "sam",
"avatar_url": "https://avatars2.githubusercontent.com/u/24604688?s=460&v=4"
}
]
}
}
}