-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocs.raml
176 lines (176 loc) · 5.68 KB
/
docs.raml
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#%RAML 1.0
---
title: Django polls API
baseUri: http://api.example.com/{version}
version: v1
mediaType: application/json
types:
Poll:
type: object
properties:
question:
required: true
type: string
created_by:
required: true
type: User
pub_date:
required: true
type: date
Choice:
type: object
properties:
poll:
required: true
type: Poll
choice_text:
required: true
type: string
Vote:
type: object
properties:
choice:
required: true
type: Choice
poll:
required: true
type: Poll
voted_by:
required: true
type: User
/polls:
get:
description: Get list of polls
queryParameters:
pollId:
description: Specify the poll id you want to retrieve
type: integer
responses:
200:
body:
application/json:
example:
{
"data":
{
"Id": 1,
"question": "Will A be the leader next time?",
"created_by": "user1",
"pub_date": "08:02:2014"
},
"success": true,
"status": 200
}
post:
description: Post a poll
queryParameters:
question:
description: Question you want to create for poll
type: string
required: true
created_by:
description: Poll created by the user
type: User
required: true
pub_date:
description: Poll created on
type: date
required: true
responses:
200:
body:
application/json:
example:
{
"success": true,
"status": 201
}
/choices:
get:
description: Get list of choices
queryParameters:
choiceId:
description: Specify the choice id you want to retrieve
type: integer
responses:
200:
body:
application/json:
example:
{
"data":
{
"Id": 1,
"poll": "Will A be the leader next time?",
"choice_text": "user1"
},
"success": true,
"status": 200
}
post:
description: Post a choice
queryParameters:
poll:
description: Choice you want to create for poll
type: string
required: true
choice_text:
description: Choice for the poll
type: string
required: true
responses:
200:
body:
application/json:
example:
{
"success": true,
"status": 201
}
/votes:
get:
description: Get votes of polls
queryParameters:
pollId:
description: Specify the vote id you want to retrieve
type: integer
responses:
200:
body:
application/json:
example:
{
"data":
{
"Id": 1,
"poll": "Will A be the leader next time?",
"choice": "user1",
"voted_by": "user2"
},
"success": true,
"status": 200
}
post:
description: Post a vote
queryParameters:
choice:
description: Choice for the poll
type: Choice
required: true
poll:
description: Poll to be voted
type: Poll
required: true
voted_by:
description: Poll voted by
type: User
required: true
responses:
200:
body:
application/json:
example:
{
"success": true,
"status": 201
}