File tree Expand file tree Collapse file tree 1 file changed +80
-0
lines changed Expand file tree Collapse file tree 1 file changed +80
-0
lines changed Original file line number Diff line number Diff line change
1
+ FORMAT: 1A
2
+ HOST: http://polls.apiblueprint.org/
3
+
4
+ # Polls API
5
+
6
+ Polls is a simple API allowing consumers to view polls and vote in them.
7
+
8
+ ## Questions Collection [/questions]
9
+
10
+ ### List All Questions [GET ]
11
+
12
+ + Response 200 (application/json)
13
+
14
+ [
15
+ {
16
+ " question" : " Favourite programming language?" ,
17
+ " published_at" : " 2015-08-05T08:40:51.620Z" ,
18
+ " choices" : [
19
+ {
20
+ " choice" : " Swift" ,
21
+ " votes" : 2048
22
+ }, {
23
+ " choice" : " Python" ,
24
+ " votes" : 1024
25
+ }, {
26
+ " choice" : " Objective-C" ,
27
+ " votes" : 512
28
+ }, {
29
+ " choice" : " Ruby" ,
30
+ " votes" : 256
31
+ }
32
+ ]
33
+ }
34
+ ]
35
+
36
+ ### Create a New Question [POST ]
37
+
38
+ You may create your own question using this action. It takes a JSON
39
+ object containing a question and a collection of answers in the
40
+ form of choices.
41
+
42
+ + Request (application/json)
43
+
44
+ {
45
+ "question": "Favourite programming language?",
46
+ "choices": [
47
+ "Swift",
48
+ "Python",
49
+ "Objective- C",
50
+ "Ruby"
51
+ ]
52
+ }
53
+
54
+ + Response 201 (application/json)
55
+
56
+ + Headers
57
+
58
+ Location : /questions/2
59
+
60
+ + Body
61
+
62
+ {
63
+ " question" : " Favourite programming language?" ,
64
+ " published_at" : " 2015-08-05T08:40:51.620Z" ,
65
+ " choices" : [
66
+ {
67
+ " choice" : " Swift" ,
68
+ " votes" : 0
69
+ }, {
70
+ " choice" : " Python" ,
71
+ " votes" : 0
72
+ }, {
73
+ " choice" : " Objective-C" ,
74
+ " votes" : 0
75
+ }, {
76
+ " choice" : " Ruby" ,
77
+ " votes" : 0
78
+ }
79
+ ]
80
+ }
You can’t perform that action at this time.
0 commit comments