This repository has been archived by the owner on Oct 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrequests.http
160 lines (128 loc) · 3.16 KB
/
requests.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
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
### Request login code (sent to mailbox)
POST {{url}}/user/login/request
Accept: application/json
Content-Type: application/json
{
"email": "dupa@gmail.com"
}
### Complete 2fa authorization
POST {{url}}/user/login/authorize
Accept: application/json
Content-Type: application/json
{
"email": "{{email}}",
"token": "{{composite_token}}",
"ts": {{composite_ts}}
}
> {% client.global.set("auth_token", response.body.json.access_token); %}
### Check whoami
GET {{url}}/user/me
Accept: application/json
Authorization: Bearer {{auth_token}}
### POLLS
### Get poll
GET {{url}}/poll
Accept: application/json
Authorization: Bearer {{auth_token}}
### Get poll
GET {{url}}/poll/7
Accept: application/json
Authorization: Bearer {{auth_token}}
### Create poll
POST {{url}}/poll
Accept: application/json
Authorization: Bearer {{auth_token}}
Content-Type: application/json
{
"name": "Sample poll 132"
}
### Edit poll
PUT {{url}}/poll/8
Accept: application/json
Authorization: Bearer {{auth_token}}
Content-Type: application/json
{
"name": "Sample polls 123"
}
### Remove poll
DELETE {{url}}/poll/13
Accept: application/json
Authorization: Bearer {{auth_token}}
### Publish poll
POST {{url}}/poll/8/publish
Accept: application/json
Authorization: Bearer {{auth_token}}
### Get link poll
GET {{url}}/poll/8/link
Accept: application/json
Authorization: Bearer {{auth_token}}
### List poll questions
GET {{url}}/poll/8/question
Accept: application/json
Authorization: Bearer {{auth_token}}
### Create poll question
POST {{url}}/poll/8/question
Accept: application/json
Authorization: Bearer {{auth_token}}
Content-Type: application/json
{
"name": "Sample question",
"type": "single"
}
### Edit poll question
PUT {{url}}/poll/8/question/1
Accept: application/json
Authorization: Bearer {{auth_token}}
Content-Type: application/json
{
"name": "Sample question123",
"required": true
}
### Edit poll question
DELETE {{url}}/poll/8/question/1
Accept: application/json
Authorization: Bearer {{auth_token}}
Content-Type: application/json
### List poll options
GET {{url}}/poll/8/question/1/option
Accept: application/json
Authorization: Bearer {{auth_token}}
### Get poll option
GET {{url}}/poll/8/question/1/option/1
Accept: application/json
Authorization: Bearer {{auth_token}}
### Add poll question
POST {{url}}/poll/8/question/1/option
Accept: application/json
Authorization: Bearer {{auth_token}}
Content-Type: application/json
{
"name": "Sample option"
}
### Edit poll question
PUT {{url}}/poll/8/question/9/option/6
Accept: application/json
Authorization: Bearer {{auth_token}}
Content-Type: application/json
{
"name": "Sample option 23"
}
### Edit poll question
DELETE {{url}}/poll/8/question/1/option/1
Accept: application/json
Authorization: Bearer {{auth_token}}
Content-Type: application/json
### Get poll data (with question and options in 1 request)
GET {{url}}/poll/8/d6313ed3403f59d41a8c1c9bd478f6c5d3d44849/data
Accept: application/json
### Vote poll
POST {{url}}/poll/8/d6313ed3403f59d41a8c1c9bd478f6c5d3d44849/vote
Accept: application/json
Content-Type: application/json
{
"1": ["Testowa"]
}
### Get all votes
GET {{url}}/poll/16/votes
Accept: application/json
Authorization: Bearer {{auth_token}}