-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.http
109 lines (84 loc) · 1.8 KB
/
api.http
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
GET http://127.0.0.1:8000/polls/
Accept: application/json
###
POST http://127.0.0.1:8000/polls/
Content-Type: application/json
Authorization: Token 96836753d98b228f3f71f88102695be9097c777c
{
"title": "test poll3",
"start_date": "2020-05-06T19:00:00",
"end_date": "2021-05-05T19:00:00"
}
###
PUT http://127.0.0.1:8000/polls/3/
Content-Type: application/json
Authorization: Token 96836753d98b228f3f71f88102695be9097c777c
{
"title": "test poll33",
"start_date": "2021-05-06T18:00:00",
"end_date": "2022-05-06T18:00:00"
}
###
GET http://127.0.0.1:8000/polls/3/
Accept: application/json
###
DELETE http://127.0.0.1:8000/polls/1/
Authorization: Token 96836753d98b228f3f71f88102695be9097c777c
###
GET http://127.0.0.1:8000/questions/
Accept: application/json
###
POST http://127.0.0.1:8000/questions/
Content-Type: application/json
Authorization: Token 96836753d98b228f3f71f88102695be9097c777c
{
"poll": 1,
"text": "multiple_variant_question",
"question_type": "multiple"
}
###
GET http://127.0.0.1:8000/questions/1/
Accept: application/json
###
GET http://127.0.0.1:8000/variants/
Accept: application/json
###
POST http://127.0.0.1:8000/variants/
Content-Type: application/json
Authorization: Token 96836753d98b228f3f71f88102695be9097c777c
{
"question": 3,
"text": "variant 4"
}
###
POST http://localhost:8000/auth/token/login/
Content-Type: application/json
{
"username":"admin",
"password":"admin"
}
###
POST http://localhost:8000/answers/
Content-Type: application/json
{
"poll": 1,
"participant_id": 10000,
"answers": [
{
"question": 1,
"text": "test"
},
{
"question": 2,
"variants": [2]
},
{
"question": 3,
"answer_variant": null,
"variants": [5,6]
}
]
}
###
GET http://127.0.0.1:8000/answers/10000/
Accept: application/json