-
Notifications
You must be signed in to change notification settings - Fork 1
/
endpoints.json
72 lines (72 loc) · 2.04 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
{
"GET /api": {
"description": "serves up a json representation of all available endpoints of the API"
},
"GET /api/aliens": {
"description": "serves an array of 24 aliens randomly selected from the aliens database",
"queries": [],
"exampleResponse": {
"aliens": [
{
"_id": "64c82a7c28ec9bd724a3842a",
"skinColour": "blue",
"skinTexture": "furry",
"eyes": 1,
"horns": 0,
"eyeColour": "green",
"isFriendly": false,
"hasAntenna": false,
"planet": "desert",
"__v": 0
}
]
}
},
"GET /api/questions": {
"description": "serves an array of all possible questions relating to alien attributes, completing end of sentence: 'Does your alien have...'",
"queries": [],
"exampleResponse": {
"questions": [
{
"question": "5 eyes?"
}
]
}
},
"GET /api/users": {
"description": "serves an array of all users, limited to 10 per page by default and sorted by score in ascending order. User can also sort by time ascending and most recent, and can limit results to last week, month or year.",
"queries": ["sort_by", "period", "page"],
"exampleResponse": {
"users": [
{
"id": "64d0c826c3344bff4ee84aea",
"username": "test user",
"score": 6,
"time": {
"minutes": 3,
"seconds": 15
},
"created_at": "2023-08-07T10:32:06.963+00:00",
"__v": 0
}
]
}
},
"POST /api/users": {
"description": "adds a single user to the user collection and returns it. Required fields are username, score, seconds and minutes. Date is created by default.",
"queries": [],
"exampleResponse": {
"user": {
"id": "64d0c826c3344bff4ee84aea",
"username": "test user",
"score": 6,
"time": {
"minutes": 3,
"seconds": 15
},
"created_at": "2023-08-07T10:32:06.963+00:00",
"__v": 0
}
}
}
}