-
Notifications
You must be signed in to change notification settings - Fork 0
/
endpoints.json
executable file
·144 lines (144 loc) · 4.27 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
{
"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": [
{
"author": "weegembump",
"title": "Seafood substitutions are increasing",
"article_id": 33,
"topic": "cooking",
"created_at": "2018-05-30T15:59:13.341Z",
"votes": 0,
"comment_count": "6"
}
]
}
},
"POST /api/articles": {
"description": "inserts a new article and responds with that article",
"queries": [],
"exampleResponse": {
"article": {
"article_id": 37,
"title": "Article Title",
"body": "An article body",
"votes": 0,
"topic": "cooking",
"author": "jessjelly",
"created_at": "2019-05-12T21:56:22.669Z",
"comment_count": 0
}
}
},
"GET /api/articles/:article_id": {
"description": "serves an article object",
"queries": [],
"exampleResponse": {
"article": {
"author": "jessjelly",
"title": "Running a Node App",
"article_id": 1,
"topic": "coding",
"created_at": "2016-08-18T12:07:52.389Z",
"votes": 24,
"body": "The text of the body...",
"comment_count": "8"
}
}
},
"PATCH /api/articles/:article_id": {
"description": "accepts an object in the form { inc_votes: newVote } and updates the article's votes property. Responds with the updated article",
"queries": [],
"patch body": { "inc_votes": "newVote (num)" },
"exampleResponse": {
"article": {
"author": "jessjelly",
"title": "Running a Node App",
"article_id": 1,
"topic": "coding",
"created_at": "2016-08-18T12:07:52.389Z",
"votes": 25,
"body": "The text of the body...",
"comment_count": "8"
}
}
},
"GET /api/articles/:article_id/comments": {
"description": "serves an array of comments for the specified article",
"queries": ["sort_by", "order"],
"exampleResponse": {
"comments": [
{
"comment_id": 44,
"votes": 4,
"created_at": "2017-11-20T08:58:48.322Z",
"author": "grumpy19",
"body": "Error est qui id corrupti et quod enim accusantium minus. Deleniti quae ea magni officiis et qui suscipit non."
}
]
}
},
"POST /api/articles/:article_id/comments": {
"description": "inserts a new comment and responds with that comment",
"queries": [],
"post body": {
"username": "jessjelly",
"body": "example"
},
"exampleResponse": {
"comment": {
"comment_id": 301,
"author": "jessjelly",
"article_id": 1,
"votes": 0,
"created_at": "2019-05-11T22:27:32.949Z",
"body": "example"
}
}
},
"PATCH /api/comments/comment_id": {
"description": "accepts an object in the form { inc_votes: newVote } and updates the comment's votes property. Responds with the updated comment",
"queries": [],
"patch body": {
"inc_votes": "newVote (num)"
},
"exampleResponse": {
"comment": {
"comment_id": 1,
"author": "tickle122",
"article_id": 18,
"votes": 2,
"created_at": "2016-07-09T18:07:18.932Z",
"body": "Itaque quisquam est similique et est perspiciatis reprehenderit voluptatem autem. Voluptatem accusantium eius error adipisci quibusdam doloribus."
}
}
},
"DELETE /api/comments/comment_id": {
"description": "deletes a comment and responds with no content",
"queries": [],
"exampleResponse": {}
},
"GET /api/users/:username": {
"description": "responds with an object of the specified user",
"queries": [],
"exampleResponse": {
"user": {
"username": "jessjelly",
"avatar_url": "https://s-media-cache-ak0.pinimg.com/564x/39/62/ec/3962eca164e60cf46f979c1f57d4078b.jpg",
"name": "Jess Jelly"
}
}
}
}