-
Notifications
You must be signed in to change notification settings - Fork 5
/
sample_json.txt
108 lines (93 loc) · 1.72 KB
/
sample_json.txt
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
// Registration endpoint (POST)
{
"teamName": "Testing",
"teamLeader": {"name": "name1", "email": "[email protected]", "discord_ID": "pjkl#1232"},
"member1": {"name": "name2", "email": "[email protected]", "discord_ID": "rjki#1234"}
}
Response:
{
'success': 'Your team has been registered successfully.'
}
// Login endpoint (POST)
{
"email": "[email protected]",
"password": "AxdTMIL9"
}
Response:
{
"key": "token-value"
}
// Logout endpoint (POST)
Response:
{
"detail": "Successfully logged out."
}
// Participant detail endpoint (GET)
Response:
{
"name": "name1",
"email": "[email protected]",
"team": {
"teamName": "teamName",
"score": 0,
"level": 0
}
}
// Question endpoint (GET)
[
{
"qID": 2,
"level": 1,
"q_text": "question text",
"q_image": null
},
{
"qID": 3,
"level": 1,
"q_text": "question text",
"q_image": null
},
{
"qID": 4,
"level": 1,
"q_text": "question text",
"q_image": null
}
]
// Question detail endpoint (GET)
response:
[
{
"qID": 2,
"level": 1,
"q_text": "This is question 1.1",
"q_image": null
}
]
// Answer endpoint (POST)
{
"question": 1,
"ans_submitted: "answer text"
}
Response:
If answer is correct but it's a dead end,
{
'message': 'dead_end'
}, status=400
If answer is correct and it's not a dead end,
{
'message': 'correct'
}, status=201
If answer is incorrect,
{
'message': 'incorrect'
}, status=400
If request is malformed,
{
"question": [
"This field is required."
],
"ans_submitted": [
"This field is required."
]
}, status=400