-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathendpoints.json
112 lines (112 loc) · 3.31 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
{
"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 topics",
"queries": ["author", "topic", "sort_by", "order"],
"exampleResponse": {
"articles": [
{
"title": "Seafood substitutions are increasing",
"topic": "cooking",
"author": "weegembump",
"body": "Text from the article..",
"created_at": 1527695953341
}
]
}
},
"GET /api/articles/:article_id": {
"description": "servers a single article filtered by the passed article_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,
"comment_count": 11
}
},
"PATCH /api/articles/:article_id": {
"description": "increments the vote count of the selected article by the passed number",
"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": 101
}
},
"GET /api/users": {
"description": "serves an array of all users",
"queries": [],
"exampleResponse": [
{
"username": "butter_bridge",
"name": "jonny",
"avatar_url": "https://www.healthytherapies.com/wp-content/uploads/2016/06/Lime3.jpg"
},
{
"username": "icellusedkars",
"name": "sam",
"avatar_url": "https://avatars2.githubusercontent.com/u/24604688?s=460&v=4"
},
{
"username": "rogersop",
"name": "paul",
"avatar_url": "https://avatars2.githubusercontent.com/u/24394918?s=400&v=4"
},
{
"username": "lurker",
"name": "do_nothing",
"avatar_url": "https://www.golenbock.com/wp-content/uploads/2015/01/placeholder-user.png"
}
]
},
"GET /api/articles/:article_id/comments": {
"description": "serves a single comment refined by selected id",
"queries": [],
"exampleResponse": [
{
"comment_id": 16,
"body": "This is a bad article name",
"author": "butter_bridge",
"votes": 1,
"created_at": "2020-10-11T15:23:00.000Z"
}
]
},
"POST /api/articles/:article_id/comments": {
"description": "takes a new comment and adds it to the database, returning that comment",
"queries": [],
"exampleResponse": [
{
"comment_id": 19,
"body": "new comment",
"article_id": 2,
"author": "butter_bridge",
"votes": 0,
"created_at": "2022-08-05T15:20:30.639Z"
}
]
},
"DELETE /api/comments/:comment_id": {
"description": "respond with status and removes a comment from the database by selected comment_id",
"queries": [],
"exampleResponse": { "status": 204 }
}
}