aboutsummaryrefslogtreecommitdiffhomepage
path: root/apiary.apib
diff options
context:
space:
mode:
Diffstat (limited to 'apiary.apib')
-rw-r--r--apiary.apib80
1 files changed, 80 insertions, 0 deletions
diff --git a/apiary.apib b/apiary.apib
new file mode 100644
index 00000000..cd355a1e
--- /dev/null
+++ b/apiary.apib
@@ -0,0 +1,80 @@
1FORMAT: 1A
2HOST: http://polls.apiblueprint.org/
3
4# wallabag
5
6Polls 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
38You may create your own question using this action. It takes a JSON
39object containing a question and a collection of answers in the
40form 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 } \ No newline at end of file