-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathendpoints.json
More file actions
166 lines (165 loc) · 5.35 KB
/
Copy pathendpoints.json
File metadata and controls
166 lines (165 loc) · 5.35 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
{
"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/users": {
"description": "serves an array of all users",
"queries": [],
"exampleResponse": {
"users": [
{
"username": "tickle122",
"name": "Tom Tickle",
"avatar_url": "https://vignette.wikia.nocookie.net/mrmen/images/d/d6/Mr-Tickle-9a.png/revision/latest?cb=20180127221953"
},
{
"username": "grumpy19",
"name": "Paul Grump",
"avatar_url": "https://vignette.wikia.nocookie.net/mrmen/images/7/78/Mr-Grumpy-3A.PNG/revision/latest?cb=20170707233013"
},
{
"username": "happyamy2016",
"name": "Amy Happy",
"avatar_url": "https://vignette1.wikia.nocookie.net/mrmen/images/7/7f/Mr_Happy.jpg/revision/latest?cb=20140102171729"
}
]
}
},
"GET /api/articles": {
"description": "serves an array of all articles",
"queries": [
"topic",
{
"sort_by": [
"title",
"topic",
"author",
"created_at",
"votes",
"comment_count"
]
},
{ "order": ["asc", "desc"] }
],
"exampleResponse": {
"articles": [
{
"article_id": 3,
"title": "Eight pug gifs that remind me of mitch",
"topic": "mitch",
"author": "icellusedkars",
"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
},
{
"article_id": 6,
"title": "A",
"topic": "mitch",
"author": "icellusedkars",
"created_at": "2020-10-18T01:00: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": 1
}
]
}
},
"GET /api/articles/:article_id": {
"description": "serves an article object with the matching article_id, which is a numerical value corresponding to the desired article",
"queries": [],
"exampleResponse": {
"article": {
"article_id": 3,
"title": "Eight pug gifs that remind me of mitch",
"topic": "mitch",
"author": "icellusedkars",
"body": "some gifs",
"comment_count": 11,
"votes": 0,
"created_at": "2020-11-03T09:12:00.000Z",
"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": "serves an array of comments on an article with the matching article_id, which is a numerical value corresponding to the desired article",
"queries": [],
"exampleResponse": {
"comments": [
{
"comment_id": 11,
"body": "Ambidextrous marsupial",
"article_id": 3,
"author": "icellusedkars",
"votes": 0,
"created_at": "2020-09-19T23:10:00.000Z"
},
{
"comment_id": 10,
"body": "git push origin master",
"article_id": 3,
"author": "icellusedkars",
"votes": 0,
"created_at": "2020-06-20T07:24:00.000Z"
}
]
}
},
"POST /api/articles/:article_id/comments": {
"description": "Takes a JSON object containing a body and an author and POSTs the comment to the matching article_id, which is a numerical value corresponding to the desired article",
"queries": [],
"exampleBody": {
"author": "icellusedkars",
"body": "Ambidextrous marsupial"
},
"exampleResponse": {
"comments": [
{
"comment_id": 11,
"body": "Ambidextrous marsupial",
"article_id": 3,
"author": "icellusedkars",
"votes": 0,
"created_at": "2020-09-19T23:10:00.000Z"
}
]
}
},
"PATCH /api/articles/:article_id": {
"description": "Updates an article with the matching article_id, which is a numerical value corresponding to the desired article.",
"queries": [],
"keys": [
{
"key": "inc_votes",
"value": "number",
"description": "The value to increment the vote count for the specified article by. Negative values will decrement the vote count."
}
],
"exampleBody": { "inc_votes": 1 },
"exampleResponse": {
"article": {
"article_id": 3,
"title": "Eight pug gifs that remind me of mitch",
"topic": "mitch",
"author": "icellusedkars",
"body": "some gifs",
"votes": 1,
"created_at": "2020-11-03T09:12:00.000Z",
"article_img_url": "https://images.pexels.com/photos/158651/news-newsletter-newspaper-information-158651.jpeg?w=700&h=700"
}
}
},
"DELETE /api/comments/:comment_id": {
"description": "Deletes the comment with the specified comment_id, which is a numerical value corresponding to the desired comment.",
"exampleResponse": "No response"
}
}