-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathendpoints.json
More file actions
107 lines (107 loc) · 3.21 KB
/
endpoints.json
File metadata and controls
107 lines (107 loc) · 3.21 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
{
"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": ["topic", "sort_by", "order"],
"acceptedParameters": [
{
"sort_by": [
"author",
"title",
"article_id",
"topic",
"created_at",
"votes",
"comment_count"
]
},
{ "order": ["asc", "desc"] }
],
"exampleResponse": {
"articles": [
{
"title": "Seafood substitutions are increasing",
"topic": "cooking",
"article_id": 1,
"author": "weegembump",
"created_at": 1527695953341,
"votes": 100,
"comment_count": 0
}
]
}
},
"GET /api/articles/:article_id": {
"description": "serves an object with information on specified article ID",
"acceptedParameterDataType": "number",
"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
}
},
"GET /api/articles/:article_id/comments": {
"description": "serves an array with all comments and information relating to those comments for a specified article ID",
"acceptedParameterDataType": "number",
"exampleResponse": [
{
"comment_id": 500,
"votes": 100,
"created_at": "2022-10-14T12:01:00.000Z",
"author": "Josh Geeson",
"body": "This article is wild"
}
]
},
"GET /api/users": {
"description": "serves an object with an array of users objects",
"exampleResponse": [
{
"username": "jgsn93",
"name": "Josh Geeson",
"avatar_url": "https://static.wikia.nocookie.net/avatar/images/d/d6/Tenzin.png/revision/latest/top-crop/width/360/height/360?cb=20131117230615"
}
]
},
"PATCH /api/articles/:article_id": {
"description": "increments number of votes specified in the patched object",
"examplePatchedObject": { "inc_votes": 100 },
"exampleResponse": {
"article": {
"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": 150
}
}
},
"POST /api/articles/:article_id/comments": {
"description": "takes a username and body object and serves an object of the comment with full information",
"examplePostedObject": {
"username": "super_hans",
"body": "big beats are the best"
}
},
"DELETE /api/comments/:comment_id": {
"description": "serves an empty object upon successful deletion of a comment by given id",
"acceptedParameterDataType": "number",
"exampleResponse": {}
}
}