/
endpoint.json
156 lines (156 loc) · 5.75 KB
/
endpoint.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
{
"GET /api": {
"description": "serves up a json representation of all the available endpoints of the api"
},
"GET /api/users": {
"description": "serves an array of all users",
"queries": [],
"exampleResponse": [
{
"username": "lurker",
"name": "do_nothing",
"avatar_url": "https://www.golenbock.com/wp-content/uploads/2015/01/placeholder-user.png"
}
]
},
"GET /api/users/:username": {
"description": "serves a user by username",
"queries": [],
"exampleResponse": [
{
"username": "butter_bridge",
"name": "jonny",
"avatar_url": "https://www.healthytherapies.com/wp-content/uploads/2016/06/Lime3.jpg"
}
]
},
"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": [
"sorted_by",
"order"
],
"exampleResponse": {
"articles": [
{
"title": "Seafood substitutions are increasing",
"topic": "cooking",
"author": "weegembump",
"body": "Text from the article..",
"created_at": "2018-05-30T15:59:13.341Z",
"votes": 0,
"comment_count": 6
}
]
}
},
"GET /api/articles?topic=:id": {
"description": "Returns only the articles for the given topic.",
"isChildOf": "/api/articles",
"queries": [
"topic"
],
"exampleResponse": {
"articles": [
{
"article_id": 1,
"title": "Living in the shadow of a great man",
"topic": "mitch",
"author": "butter_bridge",
"body": "I find this existence challenging",
"created_at": "2020-07-09T20:11: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/:id": {
"description": "serves an array of specific article by id",
"queries": [],
"exampleResponse": {
"article_id": 1,
"title": "Living in the shadow of a great man",
"topic": "mitch",
"author": "butter_bridge",
"body": "I find this existence challenging",
"created_at": "2020-07-09T20:11:00.000Z",
"votes": 100,
"article_img_url": "https://images.pexels.com/photos/158651/news-newsletter-newspaper-information-158651.jpeg?w=700&h=700",
"comment_count": "11"
}
},
"GET /api/articles/:article_id/comments": {
"description": "serves an array of all comments for the provided article id",
"queries": [],
"exampleResponse": {
"comment": [
{
"comment_id": 15,
"body": "I am 100% sure that we're not completely sure.",
"article_id": 5,
"author": "butter_bridge",
"votes": 1,
"created_at": "2020-11-24T00:08:00.000Z"
}
]
}
},
"POST /api/articles/:article_id/comments": {
"description": "Adds a comment on article. Request body accepts an object with the username and body. Api responds with the posted comment.",
"queries": [],
"exampleResponse": {
"comment": {
"comment_id": 19,
"body": "This is my first comment!",
"article_id": 3,
"author": "butter_bridge",
"votes": 0,
"created_at": "2024-02-21T10:41:22.019Z"
}
}
},
"PATCH /api/articles/:article_id": {
"description": "update an article by article_id. Api responds with the updated comment",
"queries": [],
"exampleResponse": {
"article_id": 4,
"title": "Student SUES Mitch!",
"topic": "mitch",
"author": "rogersop",
"body": "We all love Mitch and his wonderful, unique typing style. However, the volume of his typing has ALLEGEDLY burst another students eardrums, and they are now suing for damages",
"created_at": "2020-05-06T01:14:00.000Z",
"votes": 1,
"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 given comment by id which doesn't return any data",
"queries": [],
"exampleResponse": {}
},
"PATCH /api/comments/:comment_id": {
"description": "update a comment by comment_id. Api responds with the updated comment",
"queries": [],
"exampleResponse": {
"comment_id": 3,
"body": "Replacing the quiet elegance of the dark suit and tie with the casual indifference of these muted earth tones is a form of fashion suicide, but, uh, call me crazy — onyou it works.",
"article_id": 1,
"author": "icellusedkars",
"votes": 101,
"created_at": "2020-03-01T01:13:00.000Z"
}
}
}