-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathendpoints.json
More file actions
139 lines (139 loc) · 3.36 KB
/
endpoints.json
File metadata and controls
139 lines (139 loc) · 3.36 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
{
"GET /api": {
"description": "serves up a json representation of all the available endpoints of the api",
"status": 200
},
"GET /api/topics": {
"description": "serves an array of all topics",
"queries": [],
"status": 200,
"exampleResponse": {
"topics": [{ "slug": "football", "description": "Footie!" }]
}
},
"GET /api/articles": {
"description": "serves an array of all articles",
"queries": ["article_id", "created_at", "votes", "topic"],
"status": 200,
"exampleResponse": {
"articles": [
{
"author": "rogersop",
"title": "UNCOVERED: catspiracy to bring down democracy",
"article_id": 5,
"topic": "cats",
"votes": 0,
"created_at": "2020-08-03T13:14:00.000Z",
"comment_count": 2
}
]
}
},
"GET /api/articles/:article_id": {
"description": "serves an array of articles matching a given article_id",
"params": ["article_id"],
"queries": [],
"status": 200,
"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,
"comment_count": 2
}
}
},
"PATCH /api/articles/:article_id": {
"description": "increment the votes for a given article_id by a given amount",
"params": ["article_id"],
"queries": ["inc_votes = 3"],
"status": 200,
"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": 3
}
}
},
"POST /api/articles/:article_id/comments": {
"description": "add a comment to a given article_id",
"params": ["article_id"],
"queries": [],
"body": ["username", "body"],
"status": 201,
"exampleResponse": {
"comment": {
"comment_id": 19,
"body": "What a great article",
"article_id": 2,
"author": "butter_bridge",
"votes": 0,
"created_at": "2022-03-31T14:37:11.331Z"
}
}
},
"GET /api/users": {
"description": "serves an array of all users",
"params": [],
"queries": [],
"status": 200,
"exampleResponse": {
"users": [
{
"username": "butter_bridge"
},
{
"username": "icellusedkars"
},
{
"username": "rogersop"
},
{
"username": "lurker"
}
]
}
},
"DELETE /api/comments/:comment_id": {
"description": "deletes comments based on a given comment_id",
"params": ["comment_id"],
"status": 204
},
"GET /api/users/:username": {
"description": "serves a user matching a given username",
"params": ["username"],
"status": 200,
"exampleResponse": {
"user": {
"username": "lurker",
"name": "do_nothing",
"avatar_url": "https://www.golenbock.com/wp-content/uploads/2015/01/placeholder-user.png"
}
}
},
"PATCH /api/comments/:comment_id": {
"description": "serves a user matching a given username",
"params": ["comment_id"],
"body": ["inc_votes"],
"status": 200,
"exampleResponse": {
"comment": {
"comment_id": 2,
"body": "The beautiful thing about treasure is that it exists. Got to find out what kind of sheets these are; not cotton, not rayon, silky.",
"article_id": 1,
"author": "butter_bridge",
"votes": 16,
"created_at": "2020-10-31T03:03:00.000Z"
}
}
}
}